Created
August 15, 2016 06:56
-
-
Save faizalmansor/fddd4bda9dd02e49bf5b4b8a94c0e14e to your computer and use it in GitHub Desktop.
Nginx configuration for customized single domain Yii2 advanced template
This file contains hidden or 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; | |
server_name example.localhost; | |
root /vagrant/frontend/www; | |
index index.php; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
location ~ \.php$ { | |
include fastcgi.conf; | |
} | |
} | |
location /admin { | |
return 301 /admin/; | |
} | |
location /admin/ { | |
alias /vagrant/backend/www/; | |
try_files $uri $uri/ @handler; | |
location ~ \.php$ { | |
include fastcgi.conf; | |
} | |
} | |
location @handler { | |
rewrite / /admin/index.php?$args; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment