initial commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name atlas.example.de;
|
||||
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
|
||||
server_name atlas.example.de;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/atlas.example.de/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/atlas.example.de/privkey.pem;
|
||||
|
||||
root /srv/www/wegwichtel/public;
|
||||
index index.html;
|
||||
|
||||
# Begrenzung des gesamten HTTP-Requests.
|
||||
# Wegen GPX-, Bild- und Audio-Uploads größer als das Node-Einzellimit.
|
||||
client_max_body_size 256m;
|
||||
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
|
||||
# REST-API an Atlas/Node.js weiterleiten.
|
||||
location ^~ /api/ {
|
||||
proxy_pass http://127.0.0.1:47145;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_send_timeout 120s;
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
|
||||
# Nur aktive Medien über Node.js ausliefern.
|
||||
# storage/trash bleibt dadurch vollständig unsichtbar.
|
||||
location ^~ /media/ {
|
||||
proxy_pass http://127.0.0.1:47145;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
|
||||
# Statische Anwendung direkt durch Nginx ausliefern.
|
||||
# Der Fallback unterstützt die clientseitige Seitennavigation.
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Vendor-Dateien, Skripte, CSS und Bilder cachen.
|
||||
location ~* \.(?:css|js|png|jpg|jpeg|webp|gif|svg|ico|woff|woff2)$ {
|
||||
try_files $uri =404;
|
||||
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, max-age=604800";
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user