2024-02-02 03:05:08 +01:00
|
|
|
upstream php-upstream {
|
2024-02-09 20:01:07 +01:00
|
|
|
server php:9000;
|
2024-02-02 03:05:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2024-02-09 20:01:07 +01:00
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server ipv6only=on;
|
2024-04-07 13:20:58 +02:00
|
|
|
server_name vichan;
|
2024-03-31 23:17:38 +02:00
|
|
|
root /var/www/html;
|
2024-02-09 20:01:07 +01:00
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
|
|
add_header X-Content-Type-Options "nosniff";
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
index index.html index.php;
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
charset utf-8;
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
location ~ ^([^.\?]*[^\/])$ {
|
2024-03-31 23:17:38 +02:00
|
|
|
try_files $uri @addslash;
|
2024-02-09 20:01:07 +01:00
|
|
|
}
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-03-31 23:17:38 +02:00
|
|
|
# Expire rules for static content
|
|
|
|
# Media: images, icons, video, audio, HTC
|
2024-04-18 23:33:47 +02:00
|
|
|
location ~* \.(?:jpg|jpeg|gif|png|webp|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
|
2024-02-09 20:01:07 +01:00
|
|
|
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";
|
|
|
|
}
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
location ~* \.(html)$ {
|
|
|
|
expires -1;
|
|
|
|
}
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
location @addslash {
|
2024-03-31 23:17:38 +02:00
|
|
|
return 301 $uri/;
|
2024-02-09 20:01:07 +01:00
|
|
|
}
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
location / {
|
|
|
|
try_files $uri $uri/ /index.php$is_args$args;
|
|
|
|
}
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
client_max_body_size 2G;
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
location ~ \.php$ {
|
2024-04-07 13:20:58 +02:00
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
2024-02-09 20:01:07 +01:00
|
|
|
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;
|
2024-03-31 15:41:02 +02:00
|
|
|
fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name;
|
2024-02-09 20:01:07 +01:00
|
|
|
fastcgi_read_timeout 600;
|
|
|
|
include fastcgi_params;
|
|
|
|
}
|
2024-02-02 03:05:08 +01:00
|
|
|
|
2024-02-09 20:01:07 +01:00
|
|
|
location = /favicon.ico { access_log off; log_not_found off; }
|
|
|
|
location = /robots.txt { access_log off; log_not_found off; }
|
|
|
|
}
|