Skip to content

Instantly share code, notes, and snippets.

@aman207
Last active July 3, 2020 17:17
Show Gist options
  • Save aman207/913e9b5e330c6bf04ba25e5dfd1d311f to your computer and use it in GitHub Desktop.
Save aman207/913e9b5e330c6bf04ba25e5dfd1d311f to your computer and use it in GitHub Desktop.
server {
listen 80 default_server;
index index.php index.html index.htm
server_name _;
location /csv {
alias /var/www/csv-importer/public/;
try_files $uri $uri/ @csv;
autoindex on;
sendfile off;
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php-fpm.sock;
location ~/\.ht {
deny all;
}
}
}
#https://serversforhackers.com/c/nginx-php-in-subdirectory
location @csv {
rewrite /csv/(.*)$ /csv/index.php?$query_string last;
}
location / {
root /var/www/firefly-iii/public/;
try_files $uri $uri/ /index.php?$query_string;
autoindex on;
sendfile off;
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php-fpm.sock;
location ~/\.ht {
deny all;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment