jfs

nginx config

jfs
Apr 28th, 2022 (edited)
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.44 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4.  
  5. server_name Domain;
  6. rewrite ^ https://$http_host$request_uri? permanent;
  7.  
  8. proxy_set_header X-Forwarded-For $remote_addr;
  9. server_tokens off;
  10. }
  11.  
  12. server {
  13. listen 443 ssl;
  14. listen [::]:443 ssl;
  15.  
  16. server_name DOMAIN;
  17.  
  18. ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem;
  19. ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;
  20. ssl_trusted_certificate /etc/letsencrypt/live/DOMAIN/chain.pem;
  21.  
  22. proxy_set_header X-Forwarded-For $remote_addr;
  23.  
  24. #Seafile -------------------------------------------------------------
  25.  
  26. location / {
  27. proxy_pass http://127.0.0.1:8000;
  28. proxy_set_header Host $host;
  29. proxy_set_header X-Real-IP $remote_addr;
  30. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  31. proxy_set_header X-Forwarded-Host $server_name;
  32. proxy_set_header X-Forwarded-Proto $scheme;
  33. proxy_read_timeout 1200s;
  34.  
  35. # used for view/edit office file via Office Online Server
  36. client_max_body_size 0;
  37.  
  38. access_log /var/log/nginx/seahub.access.log;
  39. error_log /var/log/nginx/seahub.error.log;
  40. }
  41.  
  42. location /seafhttp {
  43. rewrite ^/seafhttp(.*)$ $1 break;
  44. proxy_pass http://127.0.0.1:8082;
  45. client_max_body_size 0;
  46. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47. proxy_connect_timeout 36000s;
  48. proxy_read_timeout 36000s;
  49. }
  50.  
  51. location /seafmedia {
  52. rewrite ^/seafmedia(.*)$ /media$1 break;
  53. root /home/seafile/seafile-server-latest/seahub;
  54. }
  55.  
  56. location /seafdav {
  57. proxy_pass http://127.0.0.1:8080/seafdav;
  58. proxy_set_header Host $host;
  59. proxy_set_header X-Real-IP $remote_addr;
  60. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  61. proxy_set_header X-Forwarded-Host $server_name;
  62. proxy_set_header X-Forwarded-Proto $scheme;
  63. proxy_read_timeout 1200s;
  64. client_max_body_size 0;
  65.  
  66. access_log /var/log/nginx/seafdav.access.log;
  67. error_log /var/log/nginx/seafdav.error.log;
  68. }
  69.  
  70. #Baikal ----------------------------------------------------------------------
  71.  
  72. location /baikal {
  73. root /var/www/html;
  74. index index.php index.html;
  75.  
  76. rewrite ^/.well-known/caldav /dav.php redirect;
  77. rewrite ^/.well-known/carddav /dav.php redirect;
  78.  
  79. charset utf-8;
  80.  
  81. location ~ /(\.ht|Core|Specific|config) {
  82. deny all;
  83. return 404;
  84. }
  85.  
  86. location ~ ^(.+\.php)(.*)$ {
  87. try_files $fastcgi_script_name =404;
  88. include /etc/nginx/fastcgi_params;
  89. fastcgi_split_path_info ^(.+\.php)(.*)$;
  90. fastcgi_pass unix:/var/run/php/php-fpm.sock;
  91. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  92. fastcgi_param PATH_INFO $fastcgi_path_info;
  93. }
  94. }
  95.  
  96. #PHPMyadmin -------------------------------------------------------------
  97.  
  98. location /phpmyadmin {
  99. root /usr/share;
  100. index index.php index.html index.htm;
  101. location ~ ^/phpmyadmin/(.+\.php)$ {
  102. try_files $uri =404;
  103. root /var/www/html/;
  104. fastcgi_pass unix:/var/run/php/php-fpm.sock;
  105. fastcgi_index index.php;
  106. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  107. include /etc/nginx/fastcgi_params;
  108. }
  109. location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  110. root /usr/share;
  111. }
  112. }
  113.  
  114. location /wppt {
  115. root /var/www/html;
  116. index index.php index.html;
  117.  
  118. location ~ ^(.+\.php)(.*)$ {
  119. try_files $fastcgi_script_name =404;
  120. include /etc/nginx/fastcgi_params;
  121. fastcgi_split_path_info ^(.+\.php)(.*)$;
  122. fastcgi_pass unix:/var/run/php/php-fpm.sock;
  123. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  124. fastcgi_param PATH_INFO $fastcgi_path_info;
  125. }
  126. }
  127.  
  128. location /jsbin {
  129. root /var/www/html/;
  130. index index.php index.html;
  131. autoindex on;
  132. }
  133.  
  134. #Kirby -------------------------------------------------------------
  135.  
  136. location /XYZ {
  137. root /var/www/html/;
  138. index index.php index.html;
  139.  
  140. location ~* \.php$ {
  141. try_files $uri =404
  142. include /etc/nginx/fastcgi_params;
  143. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  144. fastcgi_pass unix:/var/run/php/php-fpm.sock;
  145. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  146. fastcgi_param PATH_INFO $fastcgi_path_info;
  147. }
  148. }
  149.  
  150.  
  151. #Subfolder Wildcard -------------------------------------------------------------
  152.  
  153. #location ~ /([a-z0-9]+.) {
  154. # root /var/www/html;
  155. # index index.html index.php;
  156.  
  157. # location ~ ^(.+\.php)(.*)$ {
  158. # try_files $fastcgi_script_name =404;
  159. # include /etc/nginx/fastcgi_params;
  160. # fastcgi_split_path_info ^(.+\.php)(.*)$;
  161. # fastcgi_pass unix:/var/run/php/php-fpm.sock;
  162. # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  163. # fastcgi_param PATH_INFO $fastcgi_path_info;
  164. # }
  165. #}
  166. }
  167.  
Advertisement
Add Comment
Please, Sign In to add comment