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
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