1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00
my_webapp_ynh/conf/nginx.conf
Pierre de La Morinerie 192a8c3e46 Fix path to root directory
SInce installing Yunohost 2.4, I couldn't display the `index.html` page of a vanilla my_webapp installation (404). Nginx logs displayed this error:

> [error] 6345#0: *218 open() "/usr/share/nginx/htmlindex.php" failed (2: No such file or directory), client: 82.66.214.87, server: kemenaran.eu, request: "GET /index.html HTTP/1.1", host: "kemenaran.eu"

Steps to reproduce:

1. Install Yunohost 2.4
2. Add a new custom domain (e.g. mydomain.com)
3. Install a my_webapp using this custom domain
4. Attempt to open `mydomain.com./index.html` in a web browser

Adding this trailing slash solves the issue. I'm not sure this is how it should be solved, but it fixed a painful issue for me :)
2016-05-23 05:35:20 +02:00

31 lines
863 B
Nginx Configuration File

location {LOCATION} {
alias {DESTDIR}/www/;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.html index.php ;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-{POOLNAME}.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location = {PATH}/robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
# Deny access to hidden files and directories
location ~ ^{PATH}/\. {
deny all;
}