Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Kurze URLs leiten die Umfragen nicht wie erwartet weiter

  • Jinairu
  • Jinairu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago - 2 years 5 months ago #223142 by Jinairu
Community Edition - Version 5.2.6+211213
Eigener Server


Hallo zusammen,
ich habe LimeSurvey heute neu aufgesetzt, aber ich hänge an dem selben Fehler.
Die reguläre installation funktioniert ohne Probleme. Nun möchte ich aber die URLs kürzen und habe deshalb die Nginx und die LimeSurvey config angepasst.
Das Endergebnis ist, dass das Adminpanel problemfrei funktioniert umfragen aber nicht mehr aufgerufen werden können. Das Adminpanel ändert die URLs für die Umfragevorschau wie gewünscht, nur führt die URL zu einem 404 Error.
Wo mache ich den Fehler, bzw was habe ich vergessen? Habt ihr einen Rat für mich?
Viele Grüße,
Jinairu

---

Code:
php -v
PHP 8.1.0 (cli) (built: Nov 25 2021 20:22:03) (NTS)
Zend Engine v4.1.0,
Copyright (c) Zend Technologies with Zend OPcache v8.1.0,
Copyright (c), by Zend Technologies


Code:
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3
LTS Release: 20.04


Code:
nginx -v
nginx version: nginx/1.18.0 (Ubuntu)


Code:
sudo nano /var/www/html/limesurvey/application/config/config.php
'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
// You can add your own rules here
),
'showScriptName' => false,
)


Die URL funktioniert:
my-Domain.eu/surveyAdministration/view/iSurveyID/357548
Die URL funktioniert nicht, sollte aber:
my-Domain.eu/357548

Output:
Warning: Spoiler!


Wenn ich die urlFormat=get und showScriptName=true einstelle, funktioniert die URL und die Umfrage kann durchgeführt werden:
my-Domain.eu/index.php?r=survey/index&sid=357548

Das ist meine NGINX config:
Code:
Server{
  set $host_path /var/www/html/limesurvey;
  server_name my-Domain.eu; # managed by Certbot
  root /var/www/html/limesurvey;
  charset utf-8;
  client_max_body_size 100M;
  index index.php;
  try_files $uri /index.php?r=$uri&$args;
  #Disallow reading inside php script directory, see issue with debug > 1 on note
  location ~ ^/(application|docs|framework|locale|protected|tests|themes/\w+/views)
  {
    deny all;
  }
  # Allow access to well-known directory, different usage, for example ACME Challenge for Let's Encrypt
  location ~ /\.well-known
  {
    allow all;
  }
  # Deny all attempts to access hidden files
  # such as .htaccess, .htpasswd, .DS_Store (Mac).
  location ~ /\.
  {
    deny all;
  }
  #Disallow direct read user upload files
  location ~ ^/upload/surveys/.*/fu_[a-z0-9]*$
  {
    return 444;
  }
  #Disallow uploaded potential executable files in upload directory
  location ~* /upload/.*\.(pl|cgi|py|pyc|pyo|phtml|sh|lua|php|php3|php4|php5|php6|pcgi|pcgi3|pcgi4|pcgi5|pcgi6|icn)$
  {
    return 444;
  }
  #avoid processing of calls to unexisting static files by yii
  location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$
  {
    try_files $uri =404;
  }
  location ~ \.php$
  {
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    try_files $uri index.php;
    fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  }
  listen [::]:443 ssl ipv6only=on; # managed by Certbot
  listen 443 ssl; # managed by Certbot
  ssl_certificate /etc/letsencrypt/live/my-Domain.eu/fullchain.pem; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/my-Domain.eu/privkey.pem; # managed by Certbot
  include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
Last edit: 2 years 5 months ago by Jinairu.
The topic has been locked.
Moderators: Joffm

Lime-years ahead

Online-surveys for every purse and purpose