Hello guys!
I'm trying to install flarum on an nginx config, but I can't configure my vhost correctly.
I'm rerouting my location in a specific folder using an alias, and it seems that everything is break.
Here's my nginx conf file:
location /clubV2 {
alias /var/www/ptt-newclub;
index index.php;
error_log /var/log/nginx/newclub.log;
location /clubV2/ {
try_files $uri $uri/ /clubV2/index.php?$query_string;
}
location /clubV2/api {
try_files $uri $uri/ /clubV2/api.php?$query_string;
}
location /clubV2/admin {
try_files $uri $uri/ /clubV2/admin.php?$query_string;
}
location ~* ^/clubV2/(composer\.(json|lock)|config\.php|flarum|storage|vendor) {
deny all;
return 404;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
#text/html -- text/html is gzipped by default by nginx
text/plain
text/xml;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
}
The try_files seems to do absolutely whatever he wants... If I delete $query_string, he routes me to /clubV2/index.php, but if I keep it, it routes me to /index.php (wich has absolutely nothing to do with...)
Does someone have an idea?