VPS-config/nginx/sites-available/pc-dev.conf

85 lines
1.8 KiB
Plaintext
Raw Normal View History

2020-08-03 19:28:39 +02:00
server {
listen [::]:80;
listen *:80;
# server_name dev.planet-casio.com;
server_name v5.planet-casio.com;
2020-08-27 22:45:30 +02:00
2020-08-03 19:28:39 +02:00
include common.conf;
2020-08-27 22:45:30 +02:00
access_log /var/log/nginx/pc-dev_access.log;
error_log /var/log/nginx/pc-dev_error.log;
2020-08-03 19:28:39 +02:00
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen [::]:443 ssl http2;
listen *:443 ssl http2;
# server_name dev.planet-casio.com;
server_name v5.planet-casio.com;
2020-08-27 22:45:30 +02:00
2020-08-03 19:28:39 +02:00
include common.conf;
include ssl.conf;
ssl_certificate /etc/dehydrated/certs/v5.planet-casio.com/fullchain.pem;
ssl_certificate_key /etc/dehydrated/certs/v5.planet-casio.com/privkey.pem;
# Accept bigger requests (for file uploads)
client_max_body_size 5m;
2020-08-03 19:28:39 +02:00
2020-08-27 22:45:30 +02:00
access_log /var/log/nginx/pc-dev_access.log;
access_log /var/log/nginx/pc-dev_json_access.log json_analytics;
2020-08-27 22:45:30 +02:00
error_log /var/log/nginx/pc-dev_error.log;
2020-08-03 19:28:39 +02:00
root /home/pc-dev/www;
# Serve files from /static as static files
location /static/ {
alias /home/pc-dev/www/app/static/;
2020-08-03 19:28:39 +02:00
try_files $uri =404;
2023-06-07 20:53:03 +02:00
expires 10m;
2020-08-03 19:28:39 +02:00
add_header Cache-Control "public";
include gzip.conf;
}
# Serve emoji picker
location /static/scripts/emoji-picker-element/ {
alias /home/pc-dev/extra/emoji-picker-element/;
try_files $uri =404;
expires 24h;
add_header Cache-Control "public";
include gzip.conf;
}
2020-08-03 19:28:39 +02:00
# Serve avatars
location /avatar/ {
alias /home/pc-dev/data/avatar/;
2020-08-27 22:45:30 +02:00
try_files $uri /avatar/default_avatar.png =404;
expires max;
2020-08-03 19:28:39 +02:00
add_header Cache-Control "public";
include gzip.conf;
}
# Serve files
location /fichiers/ {
alias /home/pc-dev/data/fichiers/;
2020-08-03 19:28:39 +02:00
try_files $uri =404;
2023-06-07 20:53:03 +02:00
expires max;
2020-08-03 19:28:39 +02:00
add_header Cache-Control "public";
include gzip.conf;
}
# Pass everything else to the application
location / {
try_files @fake @application;
}
location @application {
include uwsgi_params;
2020-08-27 22:45:30 +02:00
uwsgi_pass unix:/run/uwsgi.pc-dev/socket;
2020-08-03 19:28:39 +02:00
}
}