]>
Commit | Line | Data |
---|---|---|
1 | user nginx nginx; | |
2 | daemon off; | |
3 | worker_processes 4; | |
4 | pid /var/run/nginx.pid; | |
5 | ||
6 | events { | |
7 | worker_connections 768; | |
8 | } | |
9 | ||
10 | http { | |
11 | include mime.types; | |
12 | default_type application/octet-stream; | |
13 | keepalive_timeout 20; | |
14 | ||
15 | client_max_body_size 10m; | |
16 | ||
17 | index index.html index.php; | |
18 | ||
19 | server { | |
20 | listen 80; | |
21 | root /var/www/shaarli; | |
22 | ||
23 | access_log /var/log/nginx/shaarli.access.log; | |
24 | error_log /var/log/nginx/shaarli.error.log; | |
25 | ||
26 | location ~* \.(?:ico|css|js|gif|jpe?g|png|ttf|oet|woff2?)$ { | |
27 | # cache static assets | |
28 | expires max; | |
29 | add_header Pragma public; | |
30 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
31 | } | |
32 | ||
33 | location = /favicon.ico { | |
34 | # serve the Shaarli favicon from its custom location | |
35 | alias /var/www/shaarli/images/favicon.ico; | |
36 | } | |
37 | ||
38 | location /doc/html/ { | |
39 | default_type "text/html"; | |
40 | try_files $uri $uri/ $uri.html =404; | |
41 | } | |
42 | ||
43 | location / { | |
44 | # Slim - rewrite URLs & do NOT serve static files through this location | |
45 | try_files _ /index.php$is_args$args; | |
46 | } | |
47 | ||
48 | location ~ index\.php$ { | |
49 | # Slim - split URL path into (script_filename, path_info) | |
50 | try_files $uri =404; | |
51 | fastcgi_split_path_info ^(index.php)(/.+)$; | |
52 | ||
53 | # filter and proxy PHP requests to PHP-FPM | |
54 | fastcgi_pass unix:/var/run/php-fpm.sock; | |
55 | fastcgi_index index.php; | |
56 | include fastcgi.conf; | |
57 | } | |
58 | } | |
59 | } |