Problem with aliases

yosef nginx-forum at
Wed Jun 30 23:31:43 UTC 2021


Im trying to use several blocks in my server using the server IP as server
name (no domain yet), each block points to a folder containing Wordpress. I
dont know what Im doing wrong because instead of running index.php nginx is
download the file.

Here is my configuration file:

server {

listen 80;
listen [::]:80;

index index.php;


location ^~ /proj1  {
     alias /var/www/proj1/public_html;
    try_files $uri $uri/ /index.php?q=$uri&$args;

location ^~ /proj2  {
     alias /var/www/proj2/public_html;
    try_files $uri $uri/ /index.php?q=$uri&$args;

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;

Posted at Nginx Forum:,291964,291964#msg-291964

More information about the nginx mailing list