0
下面是我的配置文件和我的網站的網址是https://www.fossbytes.tk/login/,我想訪問,但我無法訪問nginx中的子頁面。在Apache我使用全部覆蓋所有;命令訪問所有頁面和子頁面,但在nginx的情況下它不起作用。Nginx返回404在子頁面上找不到錯誤
如何解決下面的配置文件和訪問nginx的所有子頁面沒有htaccess的
server {
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
ssl_certificate /etc/nginx/ssl/fossbytes.tk.crt;
ssl_certificate_key /etc/nginx/ssl/fossbytes.tk.key;
location ~ /.well-known {
allow all;
}
server_name fossbytes.tk www.fossbytes.tk;
return 301 https://$server_name$request_uri;
}
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-fossbytes.tk.conf;
include snippets/ssl-params.conf;
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php login.php index.html index.htm index.nginx-debian.html;
autoindex off;
server_name fossbyte.tk;
location/{
# First attempt to serve request as file, then
access_log off; # do not log access to static files
expires max;
}
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
}
location ~* .(woff|eot|ttf|svg|mp4|webm|jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location/{
# try_files $uri $uri/ =404;
# }
#}
我的錯誤日誌
2017/02/24 11:42:38 [error] 32739#32739: *1 open() "/var/www/html/affiliate/fonts/fontawesome-webfont.woff2" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /affiliate/fonts/fontawesome-webfont.woff2?v=4.5.0 HTTP/1.1", host: "fossbytes.tk", referrer: "https://fossbytes.tk/affiliate/css/font-awesome.min.css"
2017/02/24 11:42:38 [error] 32739#32739: *8 open() "/var/www/html/affiliate/js/angular-aria.min.js.map" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /affiliate/js/angular-aria.min.js.map HTTP/1.1", host: "fossbytes.tk"
2017/02/24 11:42:38 [error] 32739#32739: *11 open() "/var/www/html/affiliate/js/angular-route.min.js.map" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /affiliate/js/angular-route.min.js.map HTTP/1.1", host: "fossbytes.tk"
2017/02/24 11:42:38 [error] 32739#32739: *7 open() "/var/www/html/affiliate/js/angular-animate.min.js.map" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /affiliate/js/angular-animate.min.js.map HTTP/1.1", host: "fossbytes.tk"
2017/02/24 11:42:39 [error] 32739#32739: *9 open() "/var/www/html/affiliate/js/angular-messages.min.js.map" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /affiliate/js/angular-messages.min.js.map HTTP/1.1", host: "fossbytes.tk"
2017/02/24 11:42:39 [error] 32739#32739: *5 open() "/var/www/html/affiliate/fonts/fontawesome-webfont.woff2" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /affiliate/fonts/fontawesome-webfont.woff2?v=4.5.0 HTTP/2.0", host: "www.fossbytes.tk", referrer: "https://www.fossbytes.tk/affiliate/css/font-awesome.min.css"
2017/02/24 11:42:43 [error] 32739#32739: *5 open() "/var/www/html/favicon.ico" failed (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /favicon.ico HTTP/2.0", host: "www.fossbytes.tk", referrer: "https://www.fossbytes.tk/"
2017/02/24 11:45:14 [error] 32739#32739: *5 "/var/www/html/login/index.php" is not found (2: No such file or directory), client: 120.60.31.120, server: fossbyte.tk, request: "GET /login/ HTTP/2.0", host: "www.fossbytes.tk"
無法正常工作仍然會出現相同的錯誤 –
您是否重新加載服務器?什麼訪問日誌說? – bobomam
服務器重新啓動但不工作 –