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.

57 lines
1.6 KiB

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. 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 php74;
  21. include fastcgi_params;
  22. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  23. fastcgi_param SERVER_NAME $host;
  24. }
  25. }
  26. server {
  27. server_name loc.wordpress;
  28. listen 80;
  29. root $root;
  30. index index.html index.htm index.php;
  31. location / {
  32. try_files $uri $uri/ /index.php?$args;
  33. }
  34. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  35. 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)$ {
  36. access_log off;
  37. }
  38. location ~ [^/]\.php(/|$) {
  39. fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  40. if (!-f $document_root$fastcgi_script_name) {
  41. return 404;
  42. }
  43. include fastcgi_params;
  44. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  45. fastcgi_param PATH_INFO $fastcgi_path_info;
  46. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  47. fastcgi_param SERVER_NAME $host;
  48. fastcgi_pass php73;
  49. fastcgi_index index.php;
  50. }
  51. }