2017-04-09 14:50:13 +02:00
|
|
|
user nginx nginx;
|
2015-12-24 17:17:46 +01:00
|
|
|
daemon off;
|
|
|
|
worker_processes 4;
|
2017-04-09 14:50:13 +02:00
|
|
|
pid /var/run/nginx.pid;
|
2015-12-24 17:17:46 +01:00
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 768;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
include mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
keepalive_timeout 20;
|
|
|
|
|
2016-11-05 20:42:54 +01:00
|
|
|
client_max_body_size 10m;
|
|
|
|
|
2015-12-24 17:17:46 +01:00
|
|
|
index index.html index.php;
|
|
|
|
|
|
|
|
server {
|
2020-11-07 14:27:49 +01:00
|
|
|
listen 80;
|
|
|
|
root /var/www/shaarli;
|
2015-12-24 17:17:46 +01:00
|
|
|
|
|
|
|
access_log /var/log/nginx/shaarli.access.log;
|
|
|
|
error_log /var/log/nginx/shaarli.error.log;
|
|
|
|
|
2020-11-07 14:27:49 +01:00
|
|
|
location ~* \.(?:ico|css|js|gif|jpe?g|png|ttf|oet|woff2?)$ {
|
2015-12-24 17:17:46 +01:00
|
|
|
# cache static assets
|
|
|
|
expires max;
|
|
|
|
add_header Pragma public;
|
|
|
|
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
|
|
|
|
}
|
|
|
|
|
2016-11-05 19:51:03 +01:00
|
|
|
location = /favicon.ico {
|
|
|
|
# serve the Shaarli favicon from its custom location
|
|
|
|
alias /var/www/shaarli/images/favicon.ico;
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:27:49 +01:00
|
|
|
location /doc/html/ {
|
|
|
|
default_type "text/html";
|
|
|
|
try_files $uri $uri/ $uri.html =404;
|
|
|
|
}
|
|
|
|
|
2017-01-04 18:06:14 +01:00
|
|
|
location / {
|
2020-11-07 14:27:49 +01:00
|
|
|
# Slim - rewrite URLs & do NOT serve static files through this location
|
|
|
|
try_files _ /index.php$is_args$args;
|
2017-01-04 18:06:14 +01:00
|
|
|
}
|
|
|
|
|
2020-11-07 14:27:49 +01:00
|
|
|
location ~ index\.php$ {
|
2017-01-04 18:06:14 +01:00
|
|
|
# Slim - split URL path into (script_filename, path_info)
|
|
|
|
try_files $uri =404;
|
2020-11-07 14:27:49 +01:00
|
|
|
fastcgi_split_path_info ^(index.php)(/.+)$;
|
2017-01-04 18:06:14 +01:00
|
|
|
|
2015-12-24 17:17:46 +01:00
|
|
|
# filter and proxy PHP requests to PHP-FPM
|
2017-04-09 14:50:13 +02:00
|
|
|
fastcgi_pass unix:/var/run/php-fpm.sock;
|
2015-12-24 17:17:46 +01:00
|
|
|
fastcgi_index index.php;
|
|
|
|
include fastcgi.conf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|