| Matthias Andreas Benkard | c7d492a | 2017-07-29 10:02:55 +0200 | [diff] [blame] | 1 |  | 
 | 2 | server { | 
 | 3 |         listen 80; | 
 | 4 |         server_name ###SERVERNAME###; | 
 | 5 |  | 
 | 6 |         index index.php; | 
 | 7 |         root /hubzilla; | 
 | 8 |  | 
 | 9 |         fastcgi_param HTTP on; | 
 | 10 |  | 
 | 11 |         charset utf-8; | 
 | 12 |         access_log /var/log/nginx/red.log; | 
 | 13 |  | 
 | 14 |         client_max_body_size 20m; | 
 | 15 |         client_body_buffer_size 128k; | 
 | 16 |  | 
 | 17 |         location / { | 
 | 18 |                 if ($is_args != "") { | 
 | 19 |                         rewrite ^/(.*) /index.php?q=$uri&$args last; | 
 | 20 |                 } | 
 | 21 |                 rewrite ^/(.*) /index.php?q=$uri last; | 
 | 22 |         } | 
 | 23 |  | 
 | 24 |         location ^~ /.well-known/ { | 
 | 25 |                 allow all; | 
 | 26 |                 rewrite ^/(.*) /index.php?q=$uri&$args last; | 
 | 27 |         } | 
 | 28 |  | 
 | 29 |         # statically serve these file types when possible | 
 | 30 |         # otherwise fall back to front controller | 
 | 31 |         # allow browser to cache them | 
 | 32 |         # added .htm for advanced source code editor library | 
 | 33 |         location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ { | 
 | 34 |                 expires 30d; | 
 | 35 |                 try_files $uri /index.php?q=$uri&$args; | 
 | 36 |         } | 
 | 37 |  | 
 | 38 |         # block these file types | 
 | 39 |         location ~* \.(tpl|md|tgz|log|out)$ { | 
 | 40 |                 deny all; | 
 | 41 |         } | 
 | 42 |  | 
 | 43 |         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | 
 | 44 |         # or a unix socket | 
 | 45 |         location ~* \.php$ { | 
 | 46 |                 try_files $uri =404; | 
 | 47 |  | 
 | 48 |                 # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini | 
 | 49 |                 fastcgi_split_path_info ^(.+\.php)(/.+)$; | 
 | 50 |  | 
 | 51 |                 # With php5-cgi alone: | 
 | 52 |                 fastcgi_pass 127.0.0.1:9000; | 
 | 53 |                 #fastcgi_pass unix:/var/run/php5-fpm.sock; | 
 | 54 |  | 
 | 55 |                 include fastcgi_params; | 
 | 56 |                 fastcgi_index index.php; | 
 | 57 |                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | 
 | 58 |         } | 
 | 59 |  | 
 | 60 |         # deny access to all dot files | 
 | 61 |         location ~ /\. { | 
 | 62 |                 deny all; | 
 | 63 |         } | 
 | 64 |  | 
 | 65 |         #deny access to store | 
 | 66 |  | 
 | 67 |         location ~ /store { | 
 | 68 |                 deny  all; | 
 | 69 |         } | 
 | 70 | } | 
 | 71 |  |