跟新nginx配置

This commit is contained in:
zeek 2020-04-19 18:48:06 +08:00
parent 8c859c3e89
commit f34179ea5a
2 changed files with 13 additions and 2 deletions

1
nginx/passwd/passwd Normal file
View File

@ -0,0 +1 @@
admin:1E5lsIODJWatA

View File

@ -17,9 +17,12 @@ server {
return 301 https://$server_name$request_uri;
}
location ^~ /diary {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/passwd/passwd;
}
location / {
# add_header Strict-Transport-Security "max-age=31536000";
# index index.html index.htm index.php;
add_header Strict-Transport-Security "max-age=31536000";
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -46,6 +49,9 @@ server {
location /goaccess.html {
autoindex on;
}
location /4635f0aec58387682acba6c26244c4e4.html {
autoindex on;
}
location /robots.txt {
autoindex on;
@ -57,6 +63,10 @@ server {
autoindex on;
}
location /gogs/ {
rewrite ".*" https://git.zeekling.cn/$1;
}
location ~ \.php$ {
add_header Strict-Transport-Security "max-age=31536000";
include snippets/fastcgi-php.conf;