只有使用此域名,我才能访问该网站:
https://example.com [Working]也就是说,我可以访问它,但是如果我添加www,就可以访问www;我得到了403屏幕。
这是我的Nginx餐厅。文件:
server {
listen 80;
server_name domain.com;
rewrite_log on;
client_max_body_size 1000M;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
if (!-e $request_filename){
rewrite ^/(.+)/(.+)$ /index.php?id=$1&cmd=$2 last;
rewrite ^/(.+)$ /index.php?id=$1 last;
}
}
location ~* \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}发布于 2018-06-16 13:56:37
我自己找到了答案。其实答案很简单。
server_name domain.com; to server_name domain.com www.domain.com;
所以我要解决这个问题。
https://stackoverflow.com/questions/50881754
复制相似问题