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

76 lines
1.5 KiB
Plaintext

server {
listen [::]:80;
listen *:80;
# server_name dev.planet-casio.com;
server_name v5.planet-casio.com;
include common.conf;
access_log /var/log/nginx/pc-dev_access.log;
error_log /var/log/nginx/pc-dev_error.log;
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;
include common.conf;
include ssl.conf;
# Accept bigger requests (files upload)
client_max_body_size 5m;
ssl_certificate /etc/dehydrated/certs/v5.planet-casio.com/fullchain.pem;
ssl_certificate_key /etc/dehydrated/certs/v5.planet-casio.com/privkey.pem;
access_log /var/log/nginx/pc-dev_access.log;
error_log /var/log/nginx/pc-dev_error.log;
root /home/pc-dev/www;
# Serve files from /static as static files
location /static {
alias /home/pc-dev/www/app/static;
try_files $uri =404;
expires 7d;
add_header Cache-Control "public";
include gzip.conf;
}
# Serve avatars
location /avatar {
root /home/pc-dev/data;
try_files $uri /avatar/default_avatar.png =404;
expires max;
add_header Cache-Control "public";
include gzip.conf;
}
# Serve files
location /fichiers {
alias /home/pc-dev/data/fichiers;
try_files $uri =404;
expires 7d;
add_header Cache-Control "public";
include gzip.conf;
}
# Pass everything else to the application
location / {
try_files @fake @application;
}
location @application {
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi.pc-dev/socket;
}
}