Created
August 15, 2020 04:51
-
-
Save BlackMetalz/f3afedf48ae8fc4e4cb22239b6fbea30 to your computer and use it in GitHub Desktop.
Laravel and wordpress config in same site
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 blackcms.local; | |
root /var/www/wordpress; | |
index index.php index.html index.htm; | |
client_max_body_size 200m; | |
access_log /var/log/nginx/app_access.log; | |
error_log /var/log/nginx/app_error.log; | |
set $upstream_endpoint 127.0.0.1:9000; | |
location / { | |
index index.php index.html index.htm; | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location ^~ /laravel { | |
alias /var/www/wordpress/laravel/public; | |
try_files $uri $uri/ @laravel; | |
location ~ \.php { | |
fastcgi_pass unix:/run/php/php7.4-fpm.sock; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $request_filename; | |
} | |
} | |
location @laravel { | |
rewrite /laravel/(.*)$ /laravel/index.php?/$1 last; | |
} | |
location ~* \.php$ { | |
fastcgi_pass unix:/run/php/php7.4-fpm.sock; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment