I am familiar with running nginx as proxy server but I am having hard time to put things together using openshift. I have nodejs app and want to use using nginx as proxy server. This is my nginx conf file. Should I replace server_name
with service? is there other way to achieve this in openshift?
upstream myapp {
server 127.0.0.1:8080;
keepalive 8;
}
# the nginx server instance
server {
listen 0.0.0.0:80;
server_name x.x.x.x;
access_log /var/log/nginx/my-app.com.log;
location / {
autoindex on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://myapp/;
proxy_redirect off;
}
}