如果用户没加www,如何在程序上自动加www?
回复 (11)
H
引用 alsotang@huangyanxiong01 cnode也是在 nginx 做的
@alsotang 😂😂握个手
S
搞不清楚www和没有www的区别
C
自觉站在域名解析这一队了
F
引用 congk自觉站在域名解析这一队了
@AserSayHi 站在域名解析一队+1 A记录 @ 暴力无脑
M
- 为 .example.com 设置 CNAME 记录到 www.example.com
- 为 www.example.com 设置 A 记录到 ip 地址
L
引用 magicdawn为 .example.com 设置 CNAME 记录到 www.example.com 为 www.example.com 设置 A 记录到 ip 地址
@magicdawn 这是在解析域名里面设置的么?
L
H
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
if ($host != 'www.myfreax.com' ){
rewrite ^/(.*)$ http://www.myfreax.com/$1 permanent;
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
}
我是在Nginx设置的
A
引用 huangyanxiong01我是在Nginx设置的
@huangyanxiong01 cnode也是在 nginx 做的
N
参与回复
登录后即可参与回复。登录