Welcome! Log In Create A New Profile

Advanced

location, alias, php and static files

Posted by raumin 
location, alias, php and static files
January 31, 2014 08:03AM
Hello,

i've a main domain configured on my dedicated server, the access is only by SSL (redirect http to https).

Here is my only vhost http://p.ngx.cc/5c ( /etc/nginx/sites-available/domaintld )

My root directory is /opt/octopress/public and serve only static files (html/css/pictures/js/etc...) and everything is OK !

I now want to add a location https://domain.tld/piwik in this vhost, the "root" directory of piwik is /var/www/piwik .

I tried this in my vhost:

location /piwik {
alias /var/www/piwik;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

PHP is interpreted but static files are not ! This location takes the root directory /opt/octopress/ and deserve static files with wrong path.

For example:

/opt/octopress/public/piwik/plugins/Zeitgeist/images/dashboard_h_bg_hover.png is not found !!

The right location is /var/www/piwik/plugins/Zeitgeist/images/dashboard_h_bg_hover.png !!

What am i doing wrong? Thank you for any help!!

raumin
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready