I am running a production server and my web application is running at port 8099. so if front end wants to access any backend endpoint, they make a call to this url:


I need to setup production.server.com:8099 to something like api.production-server.com, which will point to production.server.com:8099. What's the best approach to this? This is for ubuntu platform.

2 Answers 2


For Nginx

server {
     server_name  https://api.production-server.com;
     location / { proxy_pass; }

see this https://stackoverflow.com/a/11034125/1992247

  • production.server.com should be replaced with api.production-server.com in my example. It worked. Jan 13, 2014 at 6:24
  • Edited to match the correct server name.
    – deepseas
    Jan 13, 2014 at 15:06

Assuming it is a apache server.

<Proxy *>
    Order deny,allow
    Allow from all

    ServerName https://production.server.com
    ProxyPass https://api.production-server.com   https://production.server.com:8099
    ProxyPassReverse https://api.production-server.com   https://production.server.com:8099
  • We use nginx here. What's the equivalent in nginx for what you suggested? Jan 10, 2014 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.