x

Bab utama

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. Panduan memulai cepat - LimeSurvey 3.0+
  3. Instalasi - LimeSurvey CE
  4. Cara merancang survei yang baik (panduan)
  5. Memulai
  6. Mengelola LimeSurvey
  7. Survei - pengantar
  8. Pengaturan survei
  9. Menu survei
  10. Struktur survei
  11. Pertanyaan - pengantar
  12. Grup pertanyaan - pengantar
  13. Survei - manajemen
  14. Opsi toolbar survei
  15. Survei multibahasa
  16. ExpressionScript Engine - Panduan memulai cepat
  17. Fitur tanpa kategori dan fitur lanjutan
  18. FAQ Umum
  19. Pemecahan Masalah
  20. Solusi Sementara
  21. Lisensi
  22. Log perubahan versi
  23. Plugin
 Actions

Contoh konfigurasi nginx LimeSurvey

From LimeSurvey Manual

Halaman ini mungkin diterjemahkan oleh mesin dan dapat mengandung kesalahan. Tampilkan versi asli bahasa Inggris · Perbaiki terjemahan ini
This page is a translated version of the page LimeSurvey nginx example configuration and the translation is 100% complete.

Contoh konfigurasi Nginx untuk LimeSurvey

Berikut adalah contoh konfigurasi untuk menjalankan LimeSurvey dengan nginx dan PHP-FPM. Sesuaikan path, nama domain, dan pengaturan socket/port PHP-FPM dengan pengaturan server Anda.

Catatan: Ini adalah contoh dasar. Selalu tinjau dan sesuaikan dengan kebutuhan keamanan Anda sebelum menggunakannya di lingkungan produksi.

server {
    listen 80;
    server_name survey.example.com;
    # Redirect all HTTP traffic to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name survey.example.com;

root /var/www/limesurvey;
    index index.php;

# SSL certificates
    ssl_certificate     /etc/ssl/certs/survey.example.com.crt;
    ssl_certificate_key /etc/ssl/private/survey.example.com.key;

# Recommended SSL settings
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;

client_max_body_size 100M;

access_log /var/log/nginx/limesurvey_access.log;
    error_log  /var/log/nginx/limesurvey_error.log;

location / {
        index  index.html index.php;
        try_files $uri $uri/ /index.php?$args;
    }

location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }

# Deny access to hidden files and sensitive directories
    location ~ /\.(?!well-known).* {
        deny all;
    }

location ~ ^/tmp/runtime/ {
        deny  all;
    }
location ~* /(application|protected|modules|locale|framework|vendor|tests|docs|db|application/config)/ {
        deny all;
    }

# 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;
    }

#Disallow direct read user upload files
location ~ ^/upload/surveys/.*/fu_[a-z0-9]*$ {
        return 444;
    }

location ~* \.(log|sql|htaccess)$ {
        deny all;
    }

# Allow LimeSurvey to serve uploaded files and assets
    location /upload/ {
        try_files $uri $uri/ =404;
    }
}

Penjelasan direktif utama

  • fastcgi_pass: Mengarah ke socket PHP-FPM atau alamat TCP yang menangani permintaan PHP. Perbarui ini agar sesuai dengan konfigurasi pool PHP-FPM Anda.
  • try_files: Memastikan URL diarahkan dengan benar melalui front controller LimeSurvey (index.php).
  • client_max_body_size: Meningkatkan ukuran unggah maksimum, berguna untuk survei dengan pertanyaan unggah file.
  • Aturan penolakan (Deny): Memblokir akses web langsung ke file konfigurasi, log, dan direktori aplikasi yang tidak boleh dapat diakses publik.