- Posts: 85
- Thank you received: 9
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Plesk Onyx Server Nginx setup
- marcgold
- Topic Author
- Offline
- Premium Member
Less
More
5 years 1 month ago #181967
by marcgold
Plesk Onyx Server Nginx setup was created by marcgold
Hi,
Were running a Plesk Onyx 17.8 Server and have switched to Nginx server rather than use the Apache. On the plus side performance is significantly better and generally the setup works really well.
We have had one small issue and not sure if this is a bug or a configuration issue and would appreciate if anyone else can shed some light on this.
Under Survey Responses: the first two Buttons View Survey Response and View as PDF both return a Nginx 404 page not found error
This is my current Nginx.conf file with sensitive details ***
server {
listen **.**.**.**:80;
server_name ****;
server_name ****;
server_name ****;
client_max_body_size 128m;
proxy_read_timeout 3000;
root "/var/www/vhosts/***/***";
access_log "/var/www/vhosts/system/***/logs/proxy_access_log";
error_log "/var/www/vhosts/system/***/logs/proxy_error_log";
#extension letsencrypt begin
location ~ ^/\.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;
types { }
default_type text/plain;
satisfy any;
auth_basic off;
allow all;
location ~ ^/\.well-known/acme-challenge.*/\. {
deny all;
}
}
#extension letsencrypt end
location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
return 301 https://$host$request_uri;
}
location @fallback {
return 404;
}
location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip))$ {
try_files $uri @fallback;
}
location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
alias /var/www/vhosts/****/web_users/$1/$2;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "unix:///var/www/vhosts/system/****/php-fpm.sock";
include /etc/nginx/fastcgi.conf;
}
location ~ \.php(/.*)?$ {
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "unix:///var/www/vhosts/system/****/php-fpm.sock";
include /etc/nginx/fastcgi.conf;
}
location ~ /$ {
index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
}
add_header X-Powered-By PleskLin;
location / {
index index.php index.htm;
try_files $uri $uri/ /index.php?$args;
}
}
Were running a Plesk Onyx 17.8 Server and have switched to Nginx server rather than use the Apache. On the plus side performance is significantly better and generally the setup works really well.
We have had one small issue and not sure if this is a bug or a configuration issue and would appreciate if anyone else can shed some light on this.
Under Survey Responses: the first two Buttons View Survey Response and View as PDF both return a Nginx 404 page not found error
This is my current Nginx.conf file with sensitive details ***
server {
listen **.**.**.**:80;
server_name ****;
server_name ****;
server_name ****;
client_max_body_size 128m;
proxy_read_timeout 3000;
root "/var/www/vhosts/***/***";
access_log "/var/www/vhosts/system/***/logs/proxy_access_log";
error_log "/var/www/vhosts/system/***/logs/proxy_error_log";
#extension letsencrypt begin
location ~ ^/\.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;
types { }
default_type text/plain;
satisfy any;
auth_basic off;
allow all;
location ~ ^/\.well-known/acme-challenge.*/\. {
deny all;
}
}
#extension letsencrypt end
location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
return 301 https://$host$request_uri;
}
location @fallback {
return 404;
}
location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip))$ {
try_files $uri @fallback;
}
location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
alias /var/www/vhosts/****/web_users/$1/$2;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "unix:///var/www/vhosts/system/****/php-fpm.sock";
include /etc/nginx/fastcgi.conf;
}
location ~ \.php(/.*)?$ {
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "unix:///var/www/vhosts/system/****/php-fpm.sock";
include /etc/nginx/fastcgi.conf;
}
location ~ /$ {
index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
}
add_header X-Powered-By PleskLin;
location / {
index index.php index.htm;
try_files $uri $uri/ /index.php?$args;
}
}
Attachments:
The topic has been locked.
- marcgold
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 85
- Thank you received: 9
5 years 1 month ago #181977
by marcgold
Replied by marcgold on topic Plesk Onyx Server Nginx setup
Just updated the Additional Nginx directives to fully include the rewrite rules so from ...location / {... onwards now reads.
location / {
index index.php index.htm;
try_files $uri $uri/ /index.php?$args;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php;
}
}
location ~ 403 {
rewrite ^(.*)$ ^/(?!\.well-known/)(.*/)?\.+ redirect;
}
location ~ /\.well-known {
}
location ~ ^/(.*/)?\.+ {
return 403;
}
This did not fix things.
But, changing the setting in config.php to showScriptName' => true, (ie turning of clean URLS, then the problem goes away.
So this is definitely something to with the re-write rules.
Can anyone please provide the correct syntax for the nginx.conf to make this work.
Thanks
Marc
location / {
index index.php index.htm;
try_files $uri $uri/ /index.php?$args;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php;
}
}
location ~ 403 {
rewrite ^(.*)$ ^/(?!\.well-known/)(.*/)?\.+ redirect;
}
location ~ /\.well-known {
}
location ~ ^/(.*/)?\.+ {
return 403;
}
This did not fix things.
But, changing the setting in config.php to showScriptName' => true, (ie turning of clean URLS, then the problem goes away.
So this is definitely something to with the re-write rules.
Can anyone please provide the correct syntax for the nginx.conf to make this work.
Thanks
Marc
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 1 month ago #181983
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Plesk Onyx Server Nginx setup
What version of LimeSurvey is used?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 1 month ago #181990
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Plesk Onyx Server Nginx setup
I like to have one …marcgold wrote: …
So this is definitely something to with the re-write rules.
Can anyone please provide the correct syntax for the nginx.conf to make this work.
…
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- marcgold
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 85
- Thank you received: 9
5 years 1 month ago #182001
by marcgold
Hi Jelo,
Current Version 3.16.1+190314
It's the weirdest thing as everything else works really well, its blisteringly fast.
The Production Server is Centos 6.1, I have spun up a Centos 7 with the same version of Plesk but the Apache / Nginx will be later versions so will report back later if this changes anything.
Marc
Replied by marcgold on topic Plesk Onyx Server Nginx setup
jelo wrote: What version of LimeSurvey is used?
Hi Jelo,
Current Version 3.16.1+190314
It's the weirdest thing as everything else works really well, its blisteringly fast.
The Production Server is Centos 6.1, I have spun up a Centos 7 with the same version of Plesk but the Apache / Nginx will be later versions so will report back later if this changes anything.
Marc
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 1 month ago - 5 years 1 month ago #182005
by jelo
The NGINX+Apache combination in Plesk is not that often tested with LimeSurvey.
LimeSurvey.org uses pure NGINX. Other use Apache or Apache with PHP-FPM.
So we have three different files for rewriting URLs
htaccess (Apache) shipped with LS
.user.ini (PHP-FPM) could be shipped with LS
nginx.conf (NGINX) manual work needed
I'm not using NGINX, so debugging is a bit difficult for me.
You might check your NGINX rules against the current htaccess rules via a converter.
www.winginx.com/en/htaccess
Can you examine the nonfancy URLs these broken buttons are using?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Plesk Onyx Server Nginx setup
CentOS7 makes more sense since CentOS6 is near EOL. But it's not causing this issue.marcgold wrote: It's the weirdest thing as everything else works really well, its blisteringly fast.
The NGINX+Apache combination in Plesk is not that often tested with LimeSurvey.
LimeSurvey.org uses pure NGINX. Other use Apache or Apache with PHP-FPM.
So we have three different files for rewriting URLs
htaccess (Apache) shipped with LS
.user.ini (PHP-FPM) could be shipped with LS
nginx.conf (NGINX) manual work needed
I'm not using NGINX, so debugging is a bit difficult for me.
You might check your NGINX rules against the current htaccess rules via a converter.
www.winginx.com/en/htaccess
Can you examine the nonfancy URLs these broken buttons are using?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 5 years 1 month ago by DenisChenu. Reason: Fix quote
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 1 month ago #182047
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Plesk Onyx Server Nginx setup
@marcgold : there are some in browse response else construction of url is near same … than edit url
Edit url (GET format) : ?r=admin/dataentry/sa/editdata/subaction/edit&surveyid=222725&id=1&browselang=
View url (GET format) : r=admin/responses/sa/view&surveyid=222725&id=1&browselang=
Edit url (PATH without index) : /admin/dataentry/sa/editdata/subaction/edit/surveyid/953474/id/2/browselang
View url (PATH without index) : /admin/responses/sa/view/surveyid/953474/id/2/browselang/
Realy strange if edit work and not view …
Edit url (GET format) : ?r=admin/dataentry/sa/editdata/subaction/edit&surveyid=222725&id=1&browselang=
View url (GET format) : r=admin/responses/sa/view&surveyid=222725&id=1&browselang=
Edit url (PATH without index) : /admin/dataentry/sa/editdata/subaction/edit/surveyid/953474/id/2/browselang
View url (PATH without index) : /admin/responses/sa/view/surveyid/953474/id/2/browselang/
Realy strange if edit work and not view …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- marcgold
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 85
- Thank you received: 9
5 years 1 month ago #182182
by marcgold
Hi Jelo,
I am unfamiliar with .user.ini so if you have any more info on this file I can troubleshoot from there.
I have already converted the .htaccess rules to Nginx compatible ones and generally these seem to be working properly.
I have examined the non fancy URLs and the results are below but I agree with @DenisChenu this is very weird as the edit URL's are very similar in construct to the view URL's which work without an issue.
View Individual Result:
In Config.php urlManager => URLFormat => “Path” ShowScriptName = True
https://<<DOMAIN NAME>>/index.php/admin/responses/sa/view/surveyid/2723/id/1/browselang/ WORKS
In Config.php urlManager => URLFormat => “Get” ShowScriptName = True
https://<<DOMAIN NAME>>/index.php?r=admin/responses/sa/view&surveyid=2723&id=1&browselang= WORKS
In Config.php urlManager => URLFormat => “Get” ShowScriptName = False
https://<<DOMAIN NAME>>/?r=admin/responses/sa/view&surveyid=2723&id=1&browselang= WORKS
In Config.php urlManager => URLFormat => “Path” ShowScriptName = False
https://<<DOMAIN NAME>>/admin/responses/sa/view/surveyid/2723/id/1/browselang/ NOT WORKING
Edit Individual Response
In Config.php urlManager => URLFormat => “Path” ShowScriptName = False
https://<<DOMAIN NAME>>/admin/dataentry/sa/editdata/subaction/edit/surveyid/2723/id/1/browselang WORKS
Replied by marcgold on topic Plesk Onyx Server Nginx setup
jelo wrote:
CentOS7 makes more sense since CentOS6 is near EOL. But it's not causing this issue.marcgold wrote: It's the weirdest thing as everything else works really well, its blisteringly fast.
The NGINX+Apache combination in Plesk is not that often tested with LimeSurvey.
LimeSurvey.org uses pure NGINX. Other use Apache or Apache with PHP-FPM.
So we have three different files for rewriting URLs
htaccess (Apache) shipped with LS
.user.ini (PHP-FPM) could be shipped with LS
nginx.conf (NGINX) manual work needed
I'm not using NGINX, so debugging is a bit difficult for me.
You might check your NGINX rules against the current htaccess rules via a converter.
www.winginx.com/en/htaccess
Can you examine the nonfancy URLs these broken buttons are using?
Hi Jelo,
I am unfamiliar with .user.ini so if you have any more info on this file I can troubleshoot from there.
I have already converted the .htaccess rules to Nginx compatible ones and generally these seem to be working properly.
I have examined the non fancy URLs and the results are below but I agree with @DenisChenu this is very weird as the edit URL's are very similar in construct to the view URL's which work without an issue.
View Individual Result:
In Config.php urlManager => URLFormat => “Path” ShowScriptName = True
https://<<DOMAIN NAME>>/index.php/admin/responses/sa/view/surveyid/2723/id/1/browselang/ WORKS
In Config.php urlManager => URLFormat => “Get” ShowScriptName = True
https://<<DOMAIN NAME>>/index.php?r=admin/responses/sa/view&surveyid=2723&id=1&browselang= WORKS
In Config.php urlManager => URLFormat => “Get” ShowScriptName = False
https://<<DOMAIN NAME>>/?r=admin/responses/sa/view&surveyid=2723&id=1&browselang= WORKS
In Config.php urlManager => URLFormat => “Path” ShowScriptName = False
https://<<DOMAIN NAME>>/admin/responses/sa/view/surveyid/2723/id/1/browselang/ NOT WORKING
Edit Individual Response
In Config.php urlManager => URLFormat => “Path” ShowScriptName = False
https://<<DOMAIN NAME>>/admin/dataentry/sa/editdata/subaction/edit/surveyid/2723/id/1/browselang WORKS
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 1 month ago #182200
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Plesk Onyx Server Nginx setup
And delete url can be worst since it send GET and POST value …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- marcgold
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 85
- Thank you received: 9
5 years 1 month ago #182208
by marcgold
Interestingly, Delete actually works without issue.
I have actually deployed a brand new install of the latest release onto a Centos 7 Running plesk, Nginx & PHP7.3 PHP-FPM
The problem still persists
However I have just tested this on Limesurvey Professional (Hosted) and it works. I believe @Jelo stated that this is also running on Nginx pure. This works as it should and is definately using URL > Path and ShowScript > False.
Therefore Im pretty convinced this is a config issue and not a bug. Do you have access to this environment and possibly share the Nginx configs responsible for the rewrites needed to make this work.
Marc
Replied by marcgold on topic Plesk Onyx Server Nginx setup
DenisChenu wrote: And delete url can be worst since it send GET and POST value …
Interestingly, Delete actually works without issue.
I have actually deployed a brand new install of the latest release onto a Centos 7 Running plesk, Nginx & PHP7.3 PHP-FPM
The problem still persists
However I have just tested this on Limesurvey Professional (Hosted) and it works. I believe @Jelo stated that this is also running on Nginx pure. This works as it should and is definately using URL > Path and ShowScript > False.
Therefore Im pretty convinced this is a config issue and not a bug. Do you have access to this environment and possibly share the Nginx configs responsible for the rewrites needed to make this work.
Marc
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
5 years 1 month ago #182211
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Plesk Onyx Server Nginx setup
Most of us here in the forum are volunteers that help to support the CE edition of Limesurvey, so as far as I know Jelo and Denis don't have access to Limesurvey Pro.
You would need to get in touch with the Limesurvey GmbH via "Support" in the top navigation or hope that someone from their team (cdorin seems to be quite active in the forum lately, haven't seen anyone else in the last weeks) will stumble upon this thread.
You would need to get in touch with the Limesurvey GmbH via "Support" in the top navigation or hope that someone from their team (cdorin seems to be quite active in the forum lately, haven't seen anyone else in the last weeks) will stumble upon this thread.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 1 month ago #182218
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Plesk Onyx Server Nginx setup
You can use irc too, cdorin answer and sometimes call Louis Or Markus
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: marcgold
The topic has been locked.