mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-15 03:17:38 +01:00
68 lines
1.8 KiB
Plaintext
68 lines
1.8 KiB
Plaintext
|
upstream php-upstream {
|
||
|
server php:9000;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 80 default_server;
|
||
|
listen [::]:80 default_server ipv6only=on;
|
||
|
server_name leftypol;
|
||
|
root /var/www-leftypol;
|
||
|
add_header X-Frame-Options "SAMEORIGIN";
|
||
|
add_header X-Content-Type-Options "nosniff";
|
||
|
|
||
|
index index.html index.php;
|
||
|
|
||
|
charset utf-8;
|
||
|
|
||
|
location ~ ^([^.\?]*[^\/])$ {
|
||
|
try_files $uri @addslash;
|
||
|
}
|
||
|
|
||
|
# Expire rules for static content
|
||
|
# 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;
|
||
|
log_not_found off;
|
||
|
add_header Cache-Control "public";
|
||
|
}
|
||
|
# CSS and Javascript
|
||
|
location ~* \.(?:css|js)$ {
|
||
|
expires 1y;
|
||
|
access_log off;
|
||
|
log_not_found off;
|
||
|
add_header Cache-Control "public";
|
||
|
}
|
||
|
|
||
|
location ~* \.(html)$ {
|
||
|
expires -1;
|
||
|
}
|
||
|
|
||
|
location @addslash {
|
||
|
return 301 $uri/;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
try_files $uri $uri/ /index.php$is_args$args;
|
||
|
}
|
||
|
|
||
|
client_max_body_size 2G;
|
||
|
|
||
|
location ~ \.php$ {
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||
|
proxy_set_header X-Request-Id $x_request_id;
|
||
|
proxy_set_header X-Forwarded-Host $host;
|
||
|
proxy_set_header Forwarded-Request-Id $x_request_id;
|
||
|
fastcgi_pass php-upstream;
|
||
|
fastcgi_index index.php;
|
||
|
fastcgi_buffers 16 16k;
|
||
|
fastcgi_buffer_size 32k;
|
||
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||
|
fastcgi_read_timeout 600;
|
||
|
include fastcgi_params;
|
||
|
}
|
||
|
|
||
|
location = /favicon.ico { access_log off; log_not_found off; }
|
||
|
location = /robots.txt { access_log off; log_not_found off; }
|
||
|
}
|