【发布时间】:2020-08-04 08:23:00
【问题描述】:
这是我在 nginx 网络服务器上的 /etc/nginx/conf.d/default.conf 文件的当前设置。我有一个 Wordpress 安装,我正在尝试使用漂亮的永久链接结构,如下所示:http://XXX.XXX.XX.X/kiosks/%postname%/
当前收到“未指定输入文件”。错误。下面是我的 default.conf:
#
# The default server
#
server {
listen 80;
server_name example.com;
root /usr/share/nginx/html;
# location / {
# root /usr/share/nginx/html;
# index index.php index.html index.htm;
# }
location /kiosks {
index index.php index.html index.htm;
try_files $uri $uri/index.php?$args;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
}
【问题讨论】:
-
您需要编辑的文件将包含在
/etc/nginx/conf.d/*.conf中。 -
@RichardSmith 好的,我正在编辑 default.conf 文件。我收到“未指定输入文件”错误。请参阅上面更新的我的 default.conf 文件。
标签: wordpress nginx server permalinks nginx-config