Unify configs, enhance SSL security
This commit is contained in:
@@ -1,30 +1,26 @@
|
||||
# -*-nginx-*-
|
||||
server{
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.crawler.fachschaften.at crawler.fachschaften.at;
|
||||
root /srv/pxy/fachschaften;
|
||||
|
||||
# Location .well known is required for certificate renewal
|
||||
location /.well-known {
|
||||
allow all;
|
||||
root /srv/pxy/fachschaften;
|
||||
allow all;
|
||||
}
|
||||
# Force SSL
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen 443 ssl http2;
|
||||
server_name www.crawler.fachschaften.at crawler.fachschaften.at;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/www.fachschaften.at/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/www.fachschaften.at/privkey.pem;
|
||||
root /srv/pxy/fachschaften;
|
||||
|
||||
location /.well-known {
|
||||
allow all;
|
||||
}
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/www.fachschaften.at/chain.pem;
|
||||
|
||||
include snippets/ssl.conf;
|
||||
|
||||
location /sections {
|
||||
auth_basic " under construction ";
|
||||
@@ -32,7 +28,6 @@ server {
|
||||
|
||||
try_files $uri @crawler;
|
||||
}
|
||||
|
||||
location /articles {
|
||||
satisfy any;
|
||||
auth_basic " under construction ";
|
||||
@@ -44,7 +39,6 @@ server {
|
||||
location /downloads {
|
||||
try_files $uri @crawler;
|
||||
}
|
||||
|
||||
location @crawler {
|
||||
proxy_pass http://fachschaften:8080;
|
||||
proxy_set_header Host $host;
|
||||
@@ -52,9 +46,7 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# error_page 503 404 410 /404.html;
|
||||
# error_page 503 404 410 /404.html;
|
||||
# access_log /var/log/crawler/nginxaccess.log;
|
||||
# error_log /var/log/crawler/nginxerror.log;
|
||||
# error_log /var/log/crawler/nginxerror.log;
|
||||
|
||||
|
||||
@@ -2,41 +2,35 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.fachschaften.at fachschaften.at;
|
||||
root /srv/pxy/fachschaften;
|
||||
# Location .well known is required for certificate renewal
|
||||
|
||||
location /.well-known {
|
||||
root /srv/pxy/fachschaften;
|
||||
allow all;
|
||||
}
|
||||
# Force SSL
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen 443 ssl http2;
|
||||
server_name www.fachschaften.at fachschaften.at;
|
||||
|
||||
# include letsencrypt.conf;
|
||||
ssl_certificate /etc/letsencrypt/live/www.fachschaften.at/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/www.fachschaften.at/privkey.pem;
|
||||
root /srv/pxy/fachschaften;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/www.fachschaften.at/chain.pem;
|
||||
|
||||
location /.well-known {
|
||||
allow all;
|
||||
}
|
||||
include snippets/ssl.conf;
|
||||
|
||||
location / {
|
||||
try_files $uri @pxy;
|
||||
}
|
||||
|
||||
location = / {
|
||||
location = / {
|
||||
return 301 https://$host/articles;
|
||||
}
|
||||
|
||||
location @pxy {
|
||||
proxy_pass http://fachschaften.local:3000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
proxy_pass http://fachschaften.local:3000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user