Created
May 27, 2018 23:52
-
-
Save mabuak/30e3070c64af687c5935141bb7cda87d to your computer and use it in GitHub Desktop.
Nginx Laravel In Subdirectory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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