Skip to content

Instantly share code, notes, and snippets.

@richardlehane
Created June 11, 2017 14:07
Show Gist options
  • Save richardlehane/9e45bd25a38adc325d1e0fabde140153 to your computer and use it in GitHub Desktop.
Save richardlehane/9e45bd25a38adc325d1e0fabde140153 to your computer and use it in GitHub Desktop.
upstream atom {
server unix:/run/php7.0-fpm.atom.sock;
}
server {
listen 80;
root /usr/share/nginx/atom;
# http://wiki.nginx.org/HttpCoreModule#server_name
# _ means catch any, but it's better if you replace this with your server
# name, e.g. archives.foobar.com
server_name _;
client_max_body_size 72M;
# http://wiki.nginx.org/HttpCoreModule#try_files
location / {
try_files $uri /index.php?$args;
}
location ~ /\. {
deny all;
return 404;
}
location ~* (\.yml|\.ini|\.tmpl)$ {
deny all;
return 404;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
return 404;
}
location ~* /uploads/r/(.*)/conf/ {
}
location ~* ^/uploads/r/(.*)$ {
include /etc/nginx/fastcgi_params;
set $index /index.php;
fastcgi_param SCRIPT_FILENAME $document_root$index;
fastcgi_param SCRIPT_NAME $index;
fastcgi_pass atom;
}
location ~ ^/private/(.*)$ {
internal;
alias /usr/share/nginx/atom/$1;
}
location ~ ^/(index|qubit_dev)\.php(/|$) {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass atom;
}
location ~* \.php$ {
deny all;
return 404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment