Skip to content

Instantly share code, notes, and snippets.

@nanoninja
Created January 14, 2020 15:38
Show Gist options
  • Save nanoninja/fc65213aed216380d6eec4ab4a1a4ccd to your computer and use it in GitHub Desktop.
Save nanoninja/fc65213aed216380d6eec4ab4a1a4ccd to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name localhost;
root /var/www/html;
error_log /var/log/nginx/localhost.error.log;
access_log /var/log/nginx/localhost.access.log;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.(htm(l)?|gif|jpg|png|css|js)$ {
root /var/www/html;
}
location ~ ^/.+\.php(/|$) {
fastcgi_pass php_server:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment