【发布时间】:2019-05-26 13:59:43
【问题描述】:
我有一个在 Nginx 上运行的网站。我遇到了一个问题,因为主页加载正常,但我无法通过主页访问任何其他链接 - 没有任何反应。
server {
server_name example.com www.example.com;
root /usr/share/nginx/example.com;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/example.com$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example/com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
Nginx 不显示该问题的日志。
【问题讨论】:
-
当我输入链接时网站 slug 发生变化,但没有显示