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.

54 lines
1.5 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. upstream php-fpm73 {
  2. server php-fpm73:9000;
  3. }
  4. upstream php-fpm74 {
  5. server php-fpm74: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. server {
  12. server_name loc.octobercms;
  13. listen 80;
  14. root $root;
  15. #include global/auth.conf;
  16. #@see https://vcs.wpstudio.ru/wpstudio/nginx-examples
  17. include includes.d/octobercms.conf;
  18. include includes.d/staticfiles.conf;
  19. location ~ ^/index.php {
  20. fastcgi_pass php-fpm74;
  21. include fastcgi_params;
  22. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  23. }
  24. }
  25. server {
  26. server_name loc.wordpress;
  27. listen 80;
  28. root $root;
  29. index index.html index.htm index.php;
  30. location / {
  31. try_files $uri $uri/ /index.php?$args;
  32. }
  33. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  34. 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)$ {
  35. access_log off;
  36. }
  37. location ~ [^/]\.php(/|$) {
  38. fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  39. if (!-f $document_root$fastcgi_script_name) {
  40. return 404;
  41. }
  42. include fastcgi_params;
  43. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  44. fastcgi_param PATH_INFO $fastcgi_path_info;
  45. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  46. fastcgi_pass php-fpm73;
  47. fastcgi_index index.php;
  48. }
  49. }