mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
a52c72b618
Former-commit-id: 2a630dde7ba043c7ff4d7ee90e008f6a3e0a7f6f [formerly 72e759c0b57effef041641fa15d2b62241a4cc22] [formerly e8f937eb644b06942c8f1e719f6b73ec78872a3c [formerly 19904b1961a61e6079ae98eaf6a1dad529ed79b4 [formerly70fb2e1a7b
]]] Former-commit-id: 2b50c1da2395ee7a3e6df267e44e2992d5551aa5 [formerly a7c0c45469e60b071c28e48a2366fbe06772010f] Former-commit-id: 782ecd4185f040b22abafdf931a3bcc2133e3843 Former-commit-id:6620808f86
51 lines
1.2 KiB
Nginx Configuration File
51 lines
1.2 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name ADDRESS;
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
|
}
|
|
|
|
server {
|
|
# SERVER BLOCK FOR ADDRESS
|
|
listen 443 ssl;
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
ssl_certificate /etc/letsencrypt/live/ADDRESS/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/ADDRESS/privkey.pem;
|
|
|
|
access_log /etc/nginx/logs/access-ADDRESS.log;
|
|
error_log /etc/nginx/logs/error-ADDRESS.log info;
|
|
root CUR_DIR;
|
|
server_name ADDRESS;
|
|
|
|
# Media: images, icons, video, audio, HTC
|
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
|
|
expires 1M;
|
|
access_log off;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
# CSS and Javascript
|
|
location ~* \.(?:css|js)$ {
|
|
expires 1y;
|
|
access_log off;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
location ^~ /static {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
location ~ ^/ {
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-NginX-Proxy true;
|
|
|
|
proxy_pass https://127.0.0.1:PORT;
|
|
proxy_redirect off;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
}
|