diff options
author | VirtualTam <virtualtam@flibidi.net> | 2016-01-02 19:19:16 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2016-01-02 19:19:16 +0100 |
commit | 66d86ea521d737b1bc92b16b9c9b4126f545916c (patch) | |
tree | e74568a125834e977725fe992f458e7739d2c57a /docker/production/nginx.conf | |
parent | 0baf7842fc0cf4cbd5ca2b8c5ae6dc7a59c07700 (diff) | |
parent | 453f4653c325dc23193e16432170bf634c42e8a2 (diff) | |
download | Shaarli-66d86ea521d737b1bc92b16b9c9b4126f545916c.tar.gz Shaarli-66d86ea521d737b1bc92b16b9c9b4126f545916c.tar.zst Shaarli-66d86ea521d737b1bc92b16b9c9b4126f545916c.zip |
Merge pull request #423 from virtualtam/docker
Docker: move Dockerfiles to the main repository
Diffstat (limited to 'docker/production/nginx.conf')
-rw-r--r-- | docker/production/nginx.conf | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docker/production/nginx.conf b/docker/production/nginx.conf new file mode 100644 index 00000000..e23c4587 --- /dev/null +++ b/docker/production/nginx.conf | |||
@@ -0,0 +1,56 @@ | |||
1 | user www-data www-data; | ||
2 | daemon off; | ||
3 | worker_processes 4; | ||
4 | |||
5 | events { | ||
6 | worker_connections 768; | ||
7 | } | ||
8 | |||
9 | http { | ||
10 | include mime.types; | ||
11 | default_type application/octet-stream; | ||
12 | keepalive_timeout 20; | ||
13 | |||
14 | index index.html index.php; | ||
15 | |||
16 | server { | ||
17 | listen 80; | ||
18 | root /var/www/shaarli; | ||
19 | |||
20 | access_log /var/log/nginx/shaarli.access.log; | ||
21 | error_log /var/log/nginx/shaarli.error.log; | ||
22 | |||
23 | location ~ /\. { | ||
24 | # deny access to dotfiles | ||
25 | access_log off; | ||
26 | log_not_found off; | ||
27 | deny all; | ||
28 | } | ||
29 | |||
30 | location ~ ~$ { | ||
31 | # deny access to temp editor files, e.g. "script.php~" | ||
32 | access_log off; | ||
33 | log_not_found off; | ||
34 | deny all; | ||
35 | } | ||
36 | |||
37 | location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | ||
38 | # cache static assets | ||
39 | expires max; | ||
40 | add_header Pragma public; | ||
41 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
42 | } | ||
43 | |||
44 | location ~ (index)\.php$ { | ||
45 | # filter and proxy PHP requests to PHP-FPM | ||
46 | fastcgi_pass unix:/var/run/php5-fpm.sock; | ||
47 | fastcgi_index index.php; | ||
48 | include fastcgi.conf; | ||
49 | } | ||
50 | |||
51 | location ~ \.php$ { | ||
52 | # deny access to all other PHP scripts | ||
53 | deny all; | ||
54 | } | ||
55 | } | ||
56 | } | ||