Skip to content

Instantly share code, notes, and snippets.

@abrahamfast
Created September 3, 2019 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abrahamfast/6c2e97970db8d88c2efef1553a46c214 to your computer and use it in GitHub Desktop.
Save abrahamfast/6c2e97970db8d88c2efef1553a46c214 to your computer and use it in GitHub Desktop.
server {
root *;
index index.php index.html index.htm;
server_name *;
charset utf-8;
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.3-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 /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