所以我试图在 LEMP 上运行 wordpress。我确实通过添加这个来修复永久链接
location / {
try_files $uri $uri/ /index.php?$args;
}
但现在我遇到了未经授权的错误。进一步来说 -
A password is required to access this web server. Please try again.
我的虚拟服务器的配置文件
server {
server_name test.com www.test.com;
listen x.x.x.x;
listen 80;
#return 301 https://$host$request_uri;
}
server {
server_name test.com www.test.com;
listen x.x.x.x;
root /home/test/public_html;
index index.php;
access_log /var/log/virtualmin/test.com_access_log;
error_log /var/log/virtualmin/test.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/test/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/test/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
access_log /var/log/nginx/test.com.access.log;
error_log /var/log/nginx/test.com.error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~ /\. {
deny all;
}
# Deny access to any files with a .php extension in the uploads directory
# Works in sub-directory installs and also in multisite network
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/php-nginx/156327396130368.sock/socket;
}
location / {
auth_basic off;
try_files $uri $uri/ /index.php?$args;
}
listen x.x.x.x:443 ssl;
ssl_certificate /home/test/ssl.cert;
ssl_certificate_key /home/test/ssl.key;
fastcgi_read_timeout 60;
}
PS :- 我正在使用虚拟分钟的预览站点功能
我尝试将 auth_basic off 添加到默认值以及每个站点配置。它只是行不通