nginx 配置文件,静态网页怎么弄
我弄的下面配置,zip可以正常,html 不行,提示401错误。server_name我用*****代替了
server {
listen 80;
server_name *********;
location / {
root /var/www/StaticResources; #网站的根目录
proxy_set_header Host $host;
}
} 试试
server {
listen 443 ssl http2;
server_name web.com;
root /var/www/StaticResources;
ssl_certificate /data/ssl/.crt;
ssl_certificate_key /data/ssl/.key;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
location ~ .*\.(html)?$ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
⠀
页:
[1]