Skip to content

Instantly share code, notes, and snippets.

@mabuak
Created May 27, 2018 23:52
Show Gist options
  • Save mabuak/30e3070c64af687c5935141bb7cda87d to your computer and use it in GitHub Desktop.
Save mabuak/30e3070c64af687c5935141bb7cda87d to your computer and use it in GitHub Desktop.
Nginx Laravel In Subdirectory
server {
listen 80;
root /home/projects/lara;
index index.html index.htm index.php;
server_name projects.loc;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /orpm {
alias /home/projects/lara/orpm/public;
try_files $uri $uri/ @orpm;
location ~ \.php$ {
fastcgi_keep_conn on;
fastcgi_pass upstream;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
location @orpm {
rewrite /orpm/(.*)$ /orpm/index.php?/$1 last;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass upstream;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment