Advertisement
aonomike

updated-ptbi-odk-test

Nov 24th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.17 KB | None | 0 0
  1. server {
  2.         listen     80;
  3.         server_name    ptbi-odk-test.globalhealthapp.net;
  4.         underscores_in_headers on;
  5.         location / {
  6.                 proxy_pass      http://localhost:8080;
  7.         }
  8. }
  9.  
  10. server {
  11.         listen 443 ssl;
  12.         server_name    ptbi-odk-test.globalhealthapp.net;
  13.        
  14.         root /home/enketo/aggregate/tomcat6/webapps/ODKAggregate;
  15.         client_max_body_size 100M;
  16.        
  17.         underscores_in_headers on;
  18.        
  19.         # Make site accessible from http://localhost/
  20.         # server_name localhost;
  21.        
  22.         ssl                  on;
  23.         ssl_certificate      /etc/nginx/ssl/server.crt;
  24.         ssl_certificate_key  /etc/nginx/ssl/server.key;
  25.         ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  26.        
  27.         ssl_session_cache    shared:SSL:20m;
  28.         ssl_session_timeout  10m;
  29.        
  30.         ssl_protocols               TLSv1.2;
  31.         ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  32.         #ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
  33.         #ssl_ciphers                RC4:HIGH:!aNULL:!MD5;
  34.        
  35.         ssl_prefer_server_ciphers  on;
  36.        
  37.         add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
  38.         add_header Access-Control-Allow-Origin "https://ptbi-enketo-test.globalhealthapp.net";
  39.        
  40.         # Proxy pass to servlet container
  41.         location / {
  42.                 proxy_pass                https://localhost:8443;
  43.                 proxy_redirect            off;              
  44.                 proxy_set_header          Host               $host;
  45.                 proxy_set_header          X-Real-IP          $remote_addr;
  46.                 proxy_set_header          X-Forwarded-For    $proxy_add_x_forwarded_for;
  47.                 proxy_set_header          X-Forwarded-Proto  https;
  48.                 proxy_set_header          Access-Control-Allow-Origin   "https://ptbi-enketo-test.globalhealthapp.net";
  49.                 proxy_buffer_size         128k;
  50.  
  51.              if ($request_method = 'OPTIONS') {
  52.                 add_header 'Access-Control-Allow-Origin' '*';
  53.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  54.                 #
  55.                 # Custom headers and headers various browsers *should* be OK with but aren't
  56.                 #
  57.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  58.                 #
  59.                 # Tell client that this pre-flight info is valid for 20 days
  60.                 #
  61.                 add_header 'Access-Control-Max-Age' 1728000;
  62.                 add_header 'Content-Type' 'text/plain charset=UTF-8';
  63.                 add_header 'Content-Length' 0;
  64.                 return 204;
  65.              }
  66.              if ($request_method = 'POST') {
  67.                 add_header 'Access-Control-Allow-Origin' 'ptbi-enketo-test.globalhealthapp.net';
  68.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  69.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,OpenRosa-Version';
  70.              }
  71.              if ($request_method = 'GET') {
  72.                 add_header 'Access-Control-Allow-Origin' 'ptbi-enketo-test.globalhealthapp.net';
  73.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  74.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,OpenRosa-Version';
  75.              }
  76.              if ($request_method = 'HEAD') {
  77.                 add_header 'Access-Control-Allow-Origin' 'ptbi-enketo-test.globalhealthapp.net';
  78.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  79.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,OpenRosa-Version';
  80.              }
  81.  
  82.         }
  83.  
  84.         location ~ ^/submission {
  85.             add_header 'Access-Control-Allow-Origin' '*';
  86.         }
  87.  
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement