Administrator

Configuring Nginx as a Reverse Proxy

Edit the nginx.conf file to configure Nginx as a reverse proxy for SAP Mobile Platform and enable SSL.

Context

The nginx.conf that you just modified to test that the Nginx Web server could be started should still be open in a text editor.

Procedure

To use Nginx reverse proxy with SSL, make the changes indicated below in the server{} section of <Nginx_Home>\conf\nginx.conf.
...
  server {
    listen     <Nginx_server_name>:8000;
    server_name  <Nginx_server_name>;

    ## edit the rest of the server{} section to look like this ##
    ssl_certificate C:/nginx-1.4.4/cert/NginxServer.crt;
    ssl_certificate_key C:/nginx-1.4.4/cert/NginxServer.key;
    
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;
    
    ssl_session_timeout  5m;

    access_log  C:/nginx-1.4.4/logs/access_8001.log;
    error_log  C:/nginx-1.4.4/logs/error_8001.log;

    root   html;
    index  index.html index.htm;
   
    location / {
      access_log off;
      proxy_pass https://<SMP_server_name>:8081/<application_name>;
      proxy_http_version 1.1;              
      proxy_set_header Upgrade $http_upgrade;              
      proxy_set_header Connection "upgrade";   
      # Go to next proxy upstream if first server is down.
      proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
      proxy_connect_timeout 5s;
     }
  }
...
For information on setting up certificates, see: