ユーザ用ツール

サイト用ツール


serverapps:nextcloud:04.nginx_config

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
serverapps:nextcloud:04.nginx_config [2023/08/07 04:44] – [/usr/local/etc/nginx/conf.d/php-fpm] hayashiserverapps:nextcloud:04.nginx_config [2023/08/26 10:55] (現在) hayashi
行 7: 行 7:
 \\ \\
  
 +===== rc.conf =====
 +
 +/etc/rc.confまたは/etc/rc.conf.localに記述
 +
 +  php_fpm_enable="YES"
 +  nginx_enable="YES"
 ===== /usr/local/etc/nginx/nginx.conf ===== ===== /usr/local/etc/nginx/nginx.conf =====
  
行 21: 行 27:
   worker_connections 1024;   worker_connections 1024;
   multi_accept        on;   multi_accept        on;
-  accept_mutex on;+  accept_mutex        on;
   accept_mutex_delay  100ms;     accept_mutex_delay  100ms;  
 } }
行 47: 行 53:
   server {   server {
     listen 80;     listen 80;
-    listen [::]:80;+    listen [::]:80;
     # server_name cloud.example.com;     # server_name cloud.example.com;
  
行 57: 行 63:
  
     # Path to the root of your installation     # Path to the root of your installation
-    root /var/www/nextcloud;+    #root /var/www/nextcloud; 
 +    root /usr/local/www/nextcloud;
  
     # HTTP response headers borrowed from Nextcloud `.htaccess`     # HTTP response headers borrowed from Nextcloud `.htaccess`
行 125: 行 132:
     # then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`     # then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`
     # to the URI, resulting in a HTTP 500 error response.     # to the URI, resulting in a HTTP 500 error response.
-    location ~ \.php(?:$|/) { +    location ~ \.php(?:$|/) { 
-        # Required for legacy support +    #     # Required for legacy support 
-        rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri; +    #     rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri; 
- +    #     fastcgi_split_path_info ^(.+?\.php)(/.*)$; 
-        fastcgi_split_path_info ^(.+?\.php)(/.*)$; +    #     set $path_info $fastcgi_path_info; 
-        set $path_info $fastcgi_path_info; +    #     try_files $fastcgi_script_name =404; 
- +    #     include fastcgi_params; 
-        try_files $fastcgi_script_name =404; +    #     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
- +    #     fastcgi_param PATH_INFO $path_info; 
-        include fastcgi_params; +    #     fastcgi_param HTTPS on; 
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +    #     fastcgi_param modHeadersAvailable true;         # Avoid sending the security headers twice 
-        fastcgi_param PATH_INFO $path_info; +    #     fastcgi_param front_controller_active true;     # Enable pretty urls 
-        fastcgi_param HTTPS on; +    #     fastcgi_pass php-handler; 
- +    #     fastcgi_intercept_errors on; 
-        fastcgi_param modHeadersAvailable true;         # Avoid sending the security headers twice +    #     fastcgi_request_buffering off; 
-        fastcgi_param front_controller_active true;     # Enable pretty urls +    #     fastcgi_max_temp_file_size 0; 
-        fastcgi_pass php-handler; +    }  # End location
- +
-        fastcgi_intercept_errors on; +
-        fastcgi_request_buffering off; +
- +
-        fastcgi_max_temp_file_size 0; +
-    }  # End location+
          
          
行 193: 行 194:
 client_body_buffer_size   512k; client_body_buffer_size   512k;
 # set max upload size and increase upload timeout: # set max upload size and increase upload timeout:
-client_max_body_size      512M;+client_max_body_size      512M; 
 +client_max_body_size      2G;        # for nextcloud
 # client_body_timeout       5s; # client_body_timeout       5s;
 client_body_timeout       300s; client_body_timeout       300s;
行 241: 行 243:
 rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri; rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
 fastcgi_pass                 unix:/var/run/php-fpm.sock; fastcgi_pass                 unix:/var/run/php-fpm.sock;
-fastcgi_param                SCRIPT_FILENAME $document_root$fastcgi_script_name; 
-try_files                    $uri = 404; 
 # fastcgi_split_path_info      ^(.+\.php)(.*)$; # fastcgi_split_path_info      ^(.+\.php)(.*)$;
 fastcgi_split_path_info      ^(.+?\.php)(/.*)$; fastcgi_split_path_info      ^(.+?\.php)(/.*)$;
 +set                          $path_info $fastcgi_path_info;
 +fastcgi_param                SCRIPT_FILENAME $document_root$fastcgi_script_name;
 +fastcgi_param                PATH_INFO $path_info;
 +try_files                    $uri = 404;
 fastcgi_index                index.php; fastcgi_index                index.php;
 fastcgi_intercept_errors     on; fastcgi_intercept_errors     on;
行 259: 行 263:
 # pkg default file # pkg default file
 include                      fastcgi_params; include                      fastcgi_params;
 +# for nextcloud
 +fastcgi_param                modHeadersAvailable     true;     # Avoid sending the security headers twice
 +fastcgi_param                front_controller_active true;     # Enable pretty urls
 +fastcgi_request_buffering    off;
 +fastcgi_max_temp_file_size   0;
 </file> </file>
  
 +
 +===== 設定チェック =====
 +
 +   # service nginx configtest
 +   または
 +   # nginx -t
serverapps/nextcloud/04.nginx_config.1691383473.txt.gz · 最終更新: 2023/08/07 04:44 by hayashi