Skip to content

Instantly share code, notes, and snippets.

@abrahamfast
Created August 19, 2018 15:23
Show Gist options
  • Save abrahamfast/25611b8edb31994dbe853a0e57217102 to your computer and use it in GitHub Desktop.
Save abrahamfast/25611b8edb31994dbe853a0e57217102 to your computer and use it in GitHub Desktop.
server {
root /var/www/backend.app.snappbit.com;
index index.php index.html index.htm;
server_name backend.app.snappbit.com;
charset utf-8;
access_log off;
error_log /var/log/nginx/backend_app_snappbit_com.error.log error;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
client_max_body_size 100M;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "max_execution_time = 180;\n
max_input_time = 180;\n
memory_limit = 256M;\n
post_max_size = 50M;\n
upload_max_filesize = 50M;";
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
location /api/v1/ {
if (!-e $request_filename){
rewrite ^/api/v1/(.*)$ /api/v1/index.php last; break;
}
}
location /portal/ {
try_files $uri $uri/ /portal/index.php?$query_string;
}
location /api/v1/portal-access {
if (!-e $request_filename){
rewrite ^/api/v1/(.*)$ /api/v1/portal-access/index.php last; break;
}
}
location ~ /reset/?$ {
try_files /reset.html =404;
}
location ^~ (data|api)/ {
if (-e $request_filename){
return 403;
}
}
location ^~ /data/logs/ {
deny all;
}
location ^~ /data/config.php {
deny all;
}
location ^~ /data/cache/ {
deny all;
}
location ^~ /data/upload/ {
deny all;
}
location ^~ /application/ {
deny all;
}
location ^~ /custom/ {
deny all;
}
location ^~ /vendor/ {
deny all;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment