Advertisement
Guest User

Untitled

a guest
Jan 15th, 2015
954
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. server{
  2. listen 80;
  3. # server_name ajaxdemo.in.ua;
  4. # proxy_set_header Host ajaxdemo.in.ua;
  5. location / {
  6. return 301 https://ajaxdemo.in.ua$request_uri;
  7. }
  8. }
  9.  
  10. server {
  11. # listen 80;
  12. listen 443 default ssl;
  13.  
  14. #ssl on;
  15. ssl_certificate /etc/nginx/ssl/server.crt;
  16. ssl_certificate_key /etc/nginx/ssl/server.key;
  17.  
  18.  
  19. # proxy_redirect off;
  20. proxy_set_header Host $host;
  21. proxy_set_header X-Real-IP $remote_addr;
  22. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23. proxy_set_header X-Forwarded-Proto $scheme;
  24. #proxy_set_header X-Forwarded-Proto http;
  25.  
  26. location / {
  27. root /data/www;
  28.  
  29. add_header 'Access-Control-Allow-Origin' *;
  30. add_header 'Access-Control-Allow-Credentials' 'true';
  31. add_header 'Access-Control-Allow-Methods' 'GET';
  32.  
  33. if ($http_cookie ~* "jsessionid=([^;]+)(?:;|$)") {
  34. set $co "jsessionid=$1";
  35. }
  36. #proxy_set_header Cookie "$co";
  37.  
  38. proxy_pass http://127.0.0.1:1666/SecurConfig/;
  39. #proxy_pass http://88.81.229.142:1666/SecurConfig/;
  40. add_before_body /header.html;
  41. add_after_body /footer.html;
  42. }
  43.  
  44.  
  45. location /SecurConfig/api/tutorial/listen {
  46.  
  47. add_header 'Access-Control-Allow-Origin' *;
  48. add_header 'Access-Control-Allow-Credentials' 'true';
  49. add_header 'Access-Control-Allow-Methods' 'GET';
  50.  
  51. ##Server sent events set
  52. proxy_set_header Connection '';
  53. proxy_http_version 1.1;
  54. chunked_transfer_encoding off;
  55.  
  56. proxy_connect_timeout 50;
  57. proxy_send_timeout 50;
  58. proxy_read_timeout 50;
  59.  
  60. proxy_buffering on;
  61. proxy_buffer_size 8k;
  62. #proxy_cache off;
  63. ##
  64.  
  65.  
  66. if ($http_cookie ~* "jsessionid=([^;]+)(?:;|$)") {
  67. set $co "jsessionid=$1";
  68. }
  69. #proxy_set_header Cookie "$co";
  70. proxy_pass http://127.0.0.1:1666/;
  71. #proxy_pass http://88.81.229.142:1666/;
  72.  
  73. }
  74.  
  75.  
  76. location /SecurConfig/ {
  77. root /data/www;
  78.  
  79. add_header 'Access-Control-Allow-Origin' *;
  80. add_header 'Access-Control-Allow-Credentials' 'true';
  81. add_header 'Access-Control-Allow-Methods' 'GET';
  82.  
  83. if ($http_cookie ~* "jsessionid=([^;]+)(?:;|$)") {
  84. set $co "jsessionid=$1";
  85. }
  86. #proxy_set_header Cookie "$co";
  87.  
  88. proxy_pass http://127.0.0.1:1666/;
  89. #proxy_pass http://88.81.229.142:1666/;
  90. add_before_body /header.html;
  91. add_after_body /footer.html;
  92. }
  93.  
  94. location ~ \.css$ {
  95. root /data/css/;
  96. }
  97.  
  98. location /header.html {
  99. root /data/www;
  100. }
  101. location /footer.html {
  102. root /data/www;
  103. }
  104.  
  105. location ~ \.(gif|jpg|png|jpeg)$ {
  106. root /data/images;
  107. }
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement