x

主な章

  1. LimeSurvey Cloud と LimeSurvey CE の比較
  2. クイックスタートガイド - LimeSurvey 3.0+
  3. インストール - LimeSurvey CE
  4. よいアンケートの作り方(ガイド)
  5. 最初のステップ
  6. LimeSurvey の構成
  7. アンケート - はじめに
  8. アンケートの設定
  9. アンケートメニュー
  10. アンケートの構成
  11. 質問 - はじめに
  12. 質問グループ - はじめに
  13. アンケート - 管理
  14. アンケートツールバーオプション
  15. 多言語アンケート
  16. ExpressionScript エンジン - クイックスタートガイド
  17. その他の高度な機能
  18. よくある質問
  19. トラブルシューティング
  20. 技術的問題の回避策
  21. ライセンス
  22. バージョン変更ログ
  23. プラグイン - 上級者向け
 Actions

LimeSurvey nginx 設定例

From LimeSurvey Manual

このページは機械翻訳されている可能性があり、誤りが含まれている場合があります。 英語の原文を表示 · この翻訳を改善する
This page is a translated version of the page LimeSurvey nginx example configuration and the translation is 100% complete.

LimeSurvey 向け Nginx 設定例

以下は、nginx と PHP-FPM で LimeSurvey を実行するための設定例です。パス、ドメイン名、PHP-FPM のソケット/ポートの設定は、お使いのサーバー環境に合わせて調整してください。

注意: これは基本的な例です。本番環境で使用する前に、必ずご自身のセキュリティ要件に合わせて内容を確認し、調整してください。

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

主なディレクティブの説明

  • fastcgi_pass: PHP リクエストを処理する PHP-FPM のソケットまたは TCP アドレスを指定します。お使いの PHP-FPM プールの設定に合わせて更新してください。
  • try_files: URL が LimeSurvey のフロントコントローラー(index.php)を通じて正しくルーティングされるようにします。
  • client_max_body_size: アップロードの最大値を引き上げます。ファイルアップロード質問を含むアンケートで役立ちます。
  • 拒否ルール: 設定ファイル、ログ、アプリケーションディレクトリなど、公開すべきでない場所へのウェブからの直接アクセスをブロックします。