Skip to content

Instantly share code, notes, and snippets.

@pubudu91
Last active Feb 3, 2016
Embed
What would you like to do?
Nginx configuration file for WSO2 GReg cluster
upstream publisherhttp{
ip_hash;
server <ip-address-publisher1>:9763;
server <ip-address-publisher2>:9763;
}
upstream publisherhttps{
ip_hash;
server <ip-address-publisher1>:9443;
server <ip-address-publisher1>:9443;
}
upstream storehttp{
ip_hash;
server <ip-address-store1>:9763;
server <ip-address-store2>:9763;
}
upstream storehttps{
ip_hash;
server <ip-address-store1>:9443;
server <ip-address-store2>:9763;
}
server {
listen 443;
server_name publisher.wso2.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_next_upstream error timeout invalid_header http_500;
proxy_connect_timeout 2;
proxy_pass https://publisherhttps$request_uri;
}
ssl on;
ssl_certificate /etc/nginx/ssl/gregpublisher.crt;
ssl_certificate_key /etc/nginx/ssl/gregpublisher.key;
}
server {
listen 80;
server_name publisher.wso2.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_next_upstream error timeout invalid_header http_500;
proxy_connect_timeout 2;
proxy_pass http://publisherhttp$request_uri;
}
}
server {
listen 443;
server_name store.wso2.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_next_upstream error timeout invalid_header http_500;
proxy_connect_timeout 2;
proxy_pass https://storehttps$request_uri;
}
ssl on;
ssl_certificate /etc/nginx/ssl/gregstore.crt;
ssl_certificate_key /etc/nginx/ssl/gregstore.key;
}
server {
listen 80;
server_name store.wso2.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_next_upstream error timeout invalid_header http_500;
proxy_connect_timeout 2;
proxy_pass http://storehttp$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment