Nginx as many apps proxy and ssl termination

Many devops using Nginx as their application proxy, so we can set the nginx not just as web server. But it can be a ssl termination and apps proxy who run in other port or socket file. this is the configuration example in nginx proxy. If you use IP and port parameter on application this is you need:

server {
    listen 80;
    server_name alfresco.vas.web.id edoc-lrt.vas.web.id;
    location / {
    #location of application IP and port
    proxy_pass http://192.168.1.253:8880;
    proxy_set_header Host $http_host;
    #proxy_set_header X-Script-Name /;
    #this is maximum file upload to application
    client_max_body_size 1000m;
    }
}

if u user sock file this is what you got

server {
    listen 80;
    server_name agenda.vas.web.id;
    location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/run/uwsgi/agenda.sock;
    }
}

For ssl termination just add ssl_certificate :
server {
listen 443 ssl;
server_name sign.vas.web.id;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/run/uwsgi/signapp.sock;
    }
}


Share on Google Plus

About Rolly Maulana Awangga

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment