Skip to content

Instantly share code, notes, and snippets.

@idelara
Created January 13, 2018 06:38
Show Gist options
  • Save idelara/73182f098f6e6f3f1ad8169f2a1292b2 to your computer and use it in GitHub Desktop.
Save idelara/73182f098f6e6f3f1ad8169f2a1292b2 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
# Change this to your Laravel app location
# Make sure to add the /public directory at the end of your directory, since
# this folder is the entry point used by Laravel apps
root /var/www/html/myapp/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name myapp.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
fastcgi_pass 127.0.0.1:8080;
fastcgi_index index.php;
# include the fastcgi_param setting
include fastcgi_params;
# SCRIPT_FILENAME parameter is used for PHP FPM determining
# the script name. If it is not set in fastcgi_params file,
# i.e. /etc/nginx/fastcgi_params or in the parent contexts,
# please comment off following line:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment