laravel
- path: /var/www/html/blog
- web address: www.example.com
wordpress
- path: /var/www/html/wordpress
- web address: www.example.com/wordpress
server {
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;
server_name doki-friends.com www.doki-friends.com;
root /var/www/html/blog/public;
location / {
root /var/www/html/blog/public;
try_files $uri $uri/ /index.php?$query_string;
}
location ^~ /wordpress {
alias /var/www/html/wordpress;
try_files $uri $uri/ @wordpress;
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
location @wordpress{
rewrite /wordpress/(.*)$ /wordpress/index.php?/$1 last;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
沒有留言:
張貼留言