You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.4 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. upstream php73 {
  2. server php73:9000;
  3. }
  4. upstream php74 {
  5. server php74:9000;
  6. }
  7. map $http_host $root {
  8. loc.octobercms /usr/share/nginx/html/someproject;
  9. loc.wordpress /usr/share/nginx/html/someprojectwp;
  10. }
  11. # @see https://github.com/OFFLINE-GmbH/oc-responsive-images-plugin/#responsive-images
  12. map $http_accept $webp_suffix {
  13. default "";
  14. "~*webp" ".webp";
  15. }
  16. server {
  17. server_name
  18. loc.octobercms
  19. ;
  20. listen 80;
  21. root $root;
  22. #include global/auth.conf;
  23. #@see https://vcs.wpstudio.ru/wpstudio/nginx-examples
  24. include includes.d/octobercms.conf;
  25. include includes.d/staticfiles.conf;
  26. location ~ ^/index.php {
  27. fastcgi_pass php74;
  28. include fastcgi_params;
  29. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  30. fastcgi_param SERVER_NAME $host;
  31. }
  32. }
  33. server {
  34. server_name
  35. loc.octobercmswebp
  36. ;
  37. listen 80;
  38. root $root;
  39. include includes.d/octobercms.conf;
  40. include includes.d/offline-webp.conf;
  41. include includes.d/staticfiles.conf;
  42. location = /index.php {
  43. fastcgi_pass php74;
  44. include fastcgi_params;
  45. fastcgi_read_timeout 3000;
  46. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  47. }
  48. location = /plugins/offline/responsiveimages/webp.php {
  49. fastcgi_pass php74;
  50. include fastcgi_params;
  51. fastcgi_read_timeout 3000;
  52. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  53. }
  54. }
  55. server {
  56. server_name loc.wordpress;
  57. listen 80;
  58. root $root;
  59. index index.html index.htm index.php;
  60. location / {
  61. try_files $uri $uri/ /index.php?$args;
  62. }
  63. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  64. location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
  65. access_log off;
  66. }
  67. location ~ [^/]\.php(/|$) {
  68. fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  69. if (!-f $document_root$fastcgi_script_name) {
  70. return 404;
  71. }
  72. include fastcgi_params;
  73. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  74. fastcgi_param PATH_INFO $fastcgi_path_info;
  75. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  76. fastcgi_param SERVER_NAME $host;
  77. fastcgi_pass php73;
  78. fastcgi_index index.php;
  79. }
  80. }