Advertisement
airux

Untitled

Jun 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.13 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. server {
  4.         server_name amo.local;
  5.         rewrite ^ https://amo.local$request_uri? permanent; #301 redirect
  6. }
  7. server {
  8.         listen 443 ssl;
  9.         server_name amo.local;
  10.  
  11.  
  12.         root /var/www/amo/web;
  13.         index  index.html;
  14.         ssl_certificate /var/www/ssl/amo.local.crt;
  15.         ssl_certificate_key /var/www/ssl/amo.local.key;
  16.  
  17.  
  18.         error_log /var/log/nginx/amo.local.error.log;
  19.         access_log /var/log/nginx/access.log;
  20.  
  21.         location ~ \.php$ {
  22.                 root /var/www/amo/web;
  23.                 fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  24. #                fastcgi_pass unix:/var/run/php5-fpm.sock;
  25.                 fastcgi_index  index.html;
  26.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  27.                 include fastcgi_params;
  28.                 fastcgi_read_timeout 300;
  29.         }
  30.  
  31.         location /ws {
  32.                 proxy_pass http://127.0.0.1:8081;
  33.                 proxy_http_version 1.1;
  34.                 proxy_set_header Upgrade $http_upgrade;
  35.                 proxy_set_header Connection "upgrade";
  36.         }
  37.  
  38.         location /ws_rest {
  39.                 proxy_pass http://127.0.0.1:8081;
  40.                 proxy_redirect http://127.0.0.1:8081/ /;
  41.                 proxy_set_header Host $host;
  42.                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43.                 proxy_set_header X-Real-IP $remote_addr;
  44.         }
  45.  
  46.  
  47.         location ~ \/admin {
  48.         }
  49.  
  50.  
  51.         try_files $uri /index.php?$args;
  52. }
  53.  
  54.  
  55.  
  56. server {
  57.  
  58.         server_name task.local;
  59.  
  60.         root /var/www/task;
  61.         index   index.php;
  62.  
  63.         error_log /var/log/nginx/task.local.error.log;
  64.         access_log /var/log/nginx/access.log;
  65.  
  66.         location ~ \.php$ {
  67.                 root /var/www/task;
  68.                 fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  69.                 fastcgi_index  index.php;
  70.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  71.                 include fastcgi_params;
  72.                 fastcgi_read_timeout 300;
  73.         }
  74.  
  75.         try_files $uri /index.php?$args;
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement