Created
February 17, 2020 11:15
-
-
Save aasumitro/5a54149e2bc4d85d94373ba55590fbef to your computer and use it in GitHub Desktop.
multiple subdir nginx config
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 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
root /var/www/html; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Content-Type-Options "nosniff"; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
error_page 404 /index.php; | |
# location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
# alias /var/www/html; | |
# try_files $uri $uri/ =404; | |
# } | |
location ^~ /apps-eden { | |
alias /var/www/eden/public; | |
try_files $uri $uri/ @laravel; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/run/php/php7.3-fpm.sock; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME /var/www/eden/public/index.php; | |
} | |
} | |
location @laravel { | |
rewrite /apps-eden/(.*)$ /apps-eden/index.php?/$1 last; | |
} | |
location ^~ /apps-pos { | |
alias /var/www/spos/public; | |
try_files $uri $uri/ @laravelpos; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/run/php/php7.3-fpm.sock; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME /var/www/spos/public/index.php; | |
} | |
} | |
location @laravelpos { | |
rewrite /apps-pos/(.*)$ /apps-pos/index.php?/$1 last; | |
} | |
location / { | |
try_files $uri /index.html; | |
} | |
location ~ /\.(?!well-known).* { | |
deny all; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment