How do I forward TCP port 80 to web server (using nginx)? - Stack Overflow (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (Stack Overflow) (https://stackoverflow.com/opensearch.xml) (https://stackoverflow.com/questions/20584749/how-do-i-forward-tcp-port-80-to-web-server-using-nginx) (Feed for question 'How do I forward TCP port 80 to web server (using nginx)?') (https://stackoverflow.com/feeds/question/20584749) (site logo) Join Stack Overflow By clicking “Sign up”, you agree to our (https://stackoverflow.com/legal/terms-of-service/public) terms of service and acknowledge you have read our (https://stackoverflow.com/legal/privacy-policy) privacy policy . Sign up with Google Sign up with GitHub OR Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (https://stackoverflow.com/users/login) Log in Skip to main content (https://stackoverflow.com/) Stack Overflow (https://stackoverflow.co/) About Products (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai) OverflowAI (Search…) (Click to show search) (https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20584749%2fhow-do-i-forward-tcp-port-80-to-web-server-using-nginx) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20584749%2fhow-do-i-forward-tcp-port-80-to-web-server-using-nginx) Sign up Let's set up your homepage Select a few topics you're interested in: python javascript c# reactjs java android html flutter c++ node.js typescript css r php angular next.js spring-boot machine-learning sql excel ios azure docker Or search from our full list: (Search) Next You’ll be prompted to create an account to view your personalized homepage. (https://stackoverflow.com/) Home (https://stackoverflow.com/questions) Questions (https://stackoverflow.com/tags) Tags (https://stackoverflow.com/beta/discussions) Discussions Labs (https://chat.stackoverflow.com/?tab=all&sort=active) Chat (https://stackoverflow.com/users) Users (https://stackoverflow.com/jobs?source=so-left-nav) Jobs (https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav) Companies Collectives Communities for your favorite technologies. (https://stackoverflow.com/collectives-all) Explore all Collectives Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Try Teams for free (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Explore Teams (Illustration of upvote icon after it is clicked) Hang on, you can't upvote just yet. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. (https://stackoverflow.com/help/whats-reputation) What's reputation and how do I get it? Instead, you can save this post to reference later. Save this post for later Not now (Illustration of upvote icon after it is clicked) Hang on, you can't upvote just yet. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. (https://stackoverflow.com/help/whats-reputation) What's reputation and how do I get it? To start gaining reputation, try answering a related question. tcp nginx Find related question Not now (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://stackoverflow.com/questions/20584749/how-do-i-forward-tcp-port-80-to-web-server-using-nginx) How do I forward TCP port 80 to web server (using nginx)? (https://stackoverflow.com/questions/ask) Ask Question (2013-12-14 14:56:32Z) Asked 11 years, 4 months ago Modified (https://stackoverflow.com/questions/20584749/how-do-i-forward-tcp-port-80-to-web-server-using-nginx?lastactivity) (2013-12-14 17:10:52Z) 11 years, 4 months ago (Viewed 2,067 times) Viewed 2k times This question shows research effort; it is useful and clear 0 (This question does not show any research effort; it is unclear or not useful) Save this question. (https://stackoverflow.com/posts/20584749/timeline) Show activity on this post. I am following (http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/3/) this tutorial and I made the server work in the local network. Now I want to open to the internet. The tutorial does not go into details, except saying that "you need to forward TCP port 80 to your Web server". I did some research to understand what this means, but could not find a good step by step instructions. Can you direct me to any material that I can read to set up the server for the internet? EDIT As instructed (http://forums.afterdawn.com/thread_view.cfm/223583) here I connected to the router with 192.168.1.1 and opened the Port Forwarding/Port Triggering tab and I entered the following information: Service Name HTTP Start Port: 80 End Port: 80 Server IP Address: ServerIPAddress Is this correct? (https://stackoverflow.com/questions/tagged/tcp) (show questions tagged 'tcp') tcp (https://stackoverflow.com/questions/tagged/nginx) (show questions tagged 'nginx') nginx (https://stackoverflow.com/q/20584749) (Short permalink to this question) Share (https://stackoverflow.com/posts/20584749/edit) Improve this question Follow Follow this question to receive notifications (https://stackoverflow.com/posts/20584749/revisions) (show all edits to this post) edited (2013-12-14 16:57:31Z) Dec 14, 2013 at 16:57 Zeynel asked (2013-12-14 14:56:32Z) Dec 14, 2013 at 14:56 (https://stackoverflow.com/users/215094/zeynel) (Zeynel's user avatar) (https://stackoverflow.com/users/215094/zeynel) Zeynel Zeynel (reputation score 13,545) 13.5k (31 gold badges) 31 31 gold badges (103 silver badges) 103 103 silver badges (148 bronze badges) 148 148 bronze badges 9 Means that you have to forward http request from publicIP:80 to privateIP:80. This can be done with proxies, firewalls. Are we talking about a home network or a corporate network ? – (https://stackoverflow.com/users/2196728/user2196728) (3,057 reputation) user2196728 Commented (2013-12-14 15:02:05Z, License: CC BY-SA 3.0) Dec 14, 2013 at 15:02 (this comment was edited 2 times) @user2196728 this is a home network – (https://stackoverflow.com/users/215094/zeynel) (13,545 reputation) Zeynel Commented (2013-12-14 15:09:35Z, License: CC BY-SA 3.0) Dec 14, 2013 at 15:09 (number of 'useful comment' votes received) 1 So you certainly have a box which provides you Internet access. Login to your box and search for a feature like routing/port-forwarding config. Sorry, as i am french i cannot be more precise because i don't know which boxes types are available elsewhere in the world. But let's try : what is your box or how do you access to Internet ? – (https://stackoverflow.com/users/2196728/user2196728) (3,057 reputation) user2196728 Commented (2013-12-14 15:15:30Z, License: CC BY-SA 3.0) Dec 14, 2013 at 15:15 (this comment was edited 2 times) @user2196728 Thanks. I have cable for internet access. Is this what you mean? I am not sure how I log to the "box". Where is the box? – (https://stackoverflow.com/users/215094/zeynel) (13,545 reputation) Zeynel Commented (2013-12-14 15:38:55Z, License: CC BY-SA 3.0) Dec 14, 2013 at 15:38 (number of 'useful comment' votes received) 1 It depends, do you have a home Wifi where your phone was connected to or were you connected to an operator network (3G) ? Send me (private if you prefer) your url, i will test it – (https://stackoverflow.com/users/2196728/user2196728) (3,057 reputation) user2196728 Commented (2013-12-14 18:59:43Z, License: CC BY-SA 3.0) Dec 14, 2013 at 18:59 (this comment was edited 2 times) (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) | (Expand to show all comments on this post) Show 4 more comments 1 Answer 1 Sorted by: (https://stackoverflow.com/questions/20584749/how-do-i-forward-tcp-port-80-to-web-server-using-nginx?answertab=scoredesc#tab-top) Reset to default (scoredesc) Highest score (default) (trending) Trending (recent votes count more) (modifieddesc) Date modified (newest first) (createdasc) Date created (oldest first) This answer is useful 1 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/20585960/timeline) Show activity on this post. That means that you have to forward http request coming to your public_ip:80 to your private_ip:80. This is usually done with proxies or firewalls. As we are talking about home network here, i think you have a home box/router that provides you internet access. So you have to login to your box/router and searh for a feature like routing/port-forwarding configuration settings. Then configure it to forward port 80 to your web server private ip on port 80. (https://stackoverflow.com/a/20585960) (Short permalink to this answer) Share (https://stackoverflow.com/posts/20585960/edit) Improve this answer Follow Follow this answer to receive notifications answered (2013-12-14 17:10:52Z) Dec 14, 2013 at 17:10 (https://stackoverflow.com/users/2196728/user2196728) (user2196728's user avatar) (https://stackoverflow.com/users/2196728/user2196728) user2196728 user2196728 (reputation score) 3,057 (3 gold badges) 3 3 gold badges (18 silver badges) 18 18 silver badges (16 bronze badges) 16 16 bronze badges 1 If you are having a similar problem see also this answer for more information (http://serverfault.com/questions/561488/how-can-i-open-port-80-with-netgear-wireless-router-wnr2000v3) (how can i open port 80 with netgear wireless router wnr2000v3) serverfault.com/questions/561488/… – (https://stackoverflow.com/users/215094/zeynel) (13,545 reputation) Zeynel Commented (2013-12-15 17:18:25Z, License: CC BY-SA 3.0) Dec 15, 2013 at 17:18 (this comment was edited 1 time) (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) Your Answer Draft saved Draft discarded Sign up or (https://stackoverflow.com/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20584749%2fhow-do-i-forward-tcp-port-80-to-web-server-using-nginx%23new-answer) log in Sign up using Google Sign up using Email and Password Submit Post as a guest Name Email Required, but never shown Post as a guest Name () () Email Required, but never shown () () Post Your Answer Discard By clicking “Post Your Answer”, you agree to our (https://stackoverflow.com/legal/terms-of-service/public) terms of service and acknowledge you have read our (https://stackoverflow.com/legal/privacy-policy) privacy policy . Start asking to get answers Find the answer to your question by asking. (https://stackoverflow.com/questions/ask) Ask question Explore related questions (https://stackoverflow.com/questions/tagged/tcp) (show questions tagged 'tcp') tcp (https://stackoverflow.com/questions/tagged/nginx) (show questions tagged 'nginx') nginx See similar questions with these tags. The Overflow Blog (https://stackoverflow.blog/2025/04/28/how-self-supervised-language-revolutionized-natural-language-processing-and-gen-ai/?cb=1) (How self-supervised language revolutionized natural language processing and gen AI) How self-supervised language revolutionized natural language processing and... (https://stackoverflow.blog/2025/04/29/we-re-not-replacing-you-we-re-with-you-where-ai-meets-infrastructure/?cb=1) “We’re not replacing you; we’re with you”: Where AI meets infrastructure Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/408576/updates-to-advertising-guidelines?cb=1) Updates to advertising guidelines (Meta Stack Exchange) (https://meta.stackexchange.com/questions/408584/evolving-comments-an-experiment-to-encourage-engagement-and-follow-up-questions?cb=1) Evolving comments: An experiment to encourage engagement and follow-up questions (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned?cb=1) Policy: Generative AI (e.g., ChatGPT) is banned (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/433648/discussions-learnings-and-potential-next-steps?cb=1) Discussions learnings and potential next steps (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/433720/2025-developer-survey-call-for-feedback?cb=1) 2025 Developer Survey: Call for Feedback Related (https://stackoverflow.com/q/10829402?rq=3) (Question score (upvotes - downvotes)) 174 (https://stackoverflow.com/questions/10829402/how-to-start-nginx-via-different-portother-than-80?rq=3) How to start nginx via different port(other than 80) (https://stackoverflow.com/q/21195220?rq=3) (Question score (upvotes - downvotes)) 9 (https://stackoverflow.com/questions/21195220/how-should-you-forward-the-value-of-http-port-when-proxying?rq=3) How should you forward the value of HTTP port when proxying? (https://stackoverflow.com/q/28006417?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/28006417/nginx-how-to-forward-requests-to-a-port-using-proxy-pass?rq=3) Nginx: How to forward requests to a port using proxy_pass (https://stackoverflow.com/q/30204524?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/30204524/redirect-local-port-to-outside-network-using-nginx?rq=3) Redirect Local Port to Outside Network using Nginx (https://stackoverflow.com/q/37152886?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/37152886/nginx-not-working-on-port-80?rq=3) Nginx not working on port 80 (https://stackoverflow.com/q/37999926?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/37999926/unable-to-forward-port-80-to-8080-using-nginx?rq=3) Unable to forward port 80 to 8080 using NGINX (https://stackoverflow.com/q/50578704?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/50578704/nginx-as-tcp-forward-proxy?rq=3) Nginx as TCP forward proxy (https://stackoverflow.com/q/55863727?rq=3) (Question score (upvotes - downvotes)) 2 (https://stackoverflow.com/questions/55863727/how-to-run-nginx-on-a-different-port-other-than-80?rq=3) How to run Nginx on a different port other than 80 (https://stackoverflow.com/q/58026103?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/58026103/how-to-configure-nginx-listen-to-port-80-and-redirect-to-my-website-running-on-p?rq=3) How to configure nginx listen to port 80 and redirect to my website running on port 80? (https://stackoverflow.com/q/58385163?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/58385163/forward-a-port-with-nginx?rq=3) Forward a port with NGINX (https://stackexchange.com/questions?tab=hot) Hot Network Questions (Code Review Stack Exchange) (https://codereview.stackexchange.com/questions/295999/slow-sql-query-with-nested-subquery) Slow SQL query with nested subquery (English Language Learners Stack Exchange) (https://ell.stackexchange.com/questions/364642/possible-interpretations-of-the-phrase-yeah-right) Possible interpretations of the phrase "Yeah, right" (Academia Stack Exchange) (https://academia.stackexchange.com/questions/218195/my-work-is-being-read-but-not-used-what-can-i-improve) My work is being read but not used — what can I improve? (Bicycles Stack Exchange) (https://bicycles.stackexchange.com/questions/96691/magene-p505-power-meter-paywall) Magene P505 power meter paywall (Super User) (https://superuser.com/questions/1895071/does-the-diskpart-format-command-do-a-quick-or-full-format) Does the DiskPart "FORMAT" command do a quick or full format? (Code Golf Stack Exchange) (https://codegolf.stackexchange.com/questions/279413/output-the-32-points-of-the-compass) Output the 32 points of the compass (Blender Stack Exchange) (https://blender.stackexchange.com/questions/334013/geometry-nodes-used-to-generate-wall-layouts) Geometry Nodes used to generate wall layouts (Data Science Stack Exchange) (https://datascience.stackexchange.com/questions/131809/rounding-float-values-in-ml-models) Rounding Float Values in ML Models (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/741802/lua-babel-african-scripts-with-tcolorbox) Lua - Babel African scripts with tcolorbox (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/741804/fillbetween-odd-behaviour) Fillbetween odd behaviour (Game Development Stack Exchange) (https://gamedev.stackexchange.com/questions/213293/how-to-achieve-the-steel-division-2-frontline-dividing-area-smoothly-with-curv) How to achieve the Steel Division 2 frontline? (Dividing area smoothly with curves using a few points) (Mathematica Stack Exchange) (https://mathematica.stackexchange.com/questions/312395/boids-by-simon-woods-can-we-re-invent-further-efficient-flocking-models-to-forg) Boids by Simon Woods: can we re-invent further efficient flocking models to forge complexity from simple rules? (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/131649/awake-and-asleep) Awake and asleep (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/741663/fill-a-space-made-by-three-arcs) Fill a space made by three arcs (Information Security Stack Exchange) (https://security.stackexchange.com/questions/281185/what-is-the-drawback-of-always-generating-passphrases-for-the-user) What is the drawback of always generating passphrases for the user? (Mathematics Stack Exchange) (https://math.stackexchange.com/questions/5060972/converting-a-first-order-ode-to-second-order-ode) Converting a first-order ODE to second-order ODE (English Language & Usage Stack Exchange) (https://english.stackexchange.com/questions/631097/word-for-the-behaviour-of-those-small-fish-that-swim-alongside-whales-or-sharks) Word for the behaviour of those small fish that swim alongside whales or sharks (Physics Stack Exchange) (https://physics.stackexchange.com/questions/848666/what-is-induced-atmospheric-vibration) What is "Induced Atmospheric Vibration"? (Mathematica Stack Exchange) (https://mathematica.stackexchange.com/questions/312444/retrieving-connected-components-from-list-of-neighbors) Retrieving connected components from list of neighbors (MathOverflow) (https://mathoverflow.net/questions/491855/two-generators-of-a-left-cyclic-module-over-an-artinian-ring-must-be-unit-multip) Two generators of a left cyclic module over an Artinian ring must be unit multiples? (Law Stack Exchange) (https://law.stackexchange.com/questions/108481/how-do-you-sue-what-is-likely-to-be-a-shell-company) How do you sue what is likely to be a shell company? (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/266122/how-to-convincingly-erase-a-populations-memory) How to convincingly erase a population's memory? more hot questions (https://stackoverflow.com/feeds/question/20584749) (Feed of this question and its answers) Question feed Subscribe to RSS Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader. (https://stackoverflow.com/feeds/question/20584749) () (https://stackoverflow.com/) (https://stackoverflow.com/) Stack Overflow (https://stackoverflow.com/questions) Questions (https://stackoverflow.com/help) Help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) Chat (https://stackoverflow.co/) Products (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams) Teams (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising) Advertising (https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent) Talent (https://stackoverflow.co/) Company (https://stackoverflow.co/) About (https://stackoverflow.co/company/press/) Press (https://stackoverflow.co/company/work-here/) Work Here (https://stackoverflow.com/legal) Legal (https://stackoverflow.com/legal/privacy-policy) Privacy Policy (https://stackoverflow.com/legal/terms-of-service/public) Terms of Service (https://stackoverflow.com/contact) Contact Us Your Privacy Choices (https://stackoverflow.com/legal/cookie-policy) Cookie Policy (https://stackexchange.com/) Stack Exchange Network (https://stackexchange.com/sites#technology) Technology (https://stackexchange.com/sites#culturerecreation) Culture & recreation (https://stackexchange.com/sites#lifearts) Life & arts (https://stackexchange.com/sites#science) Science (https://stackexchange.com/sites#professional) Professional (https://stackexchange.com/sites#business) Business (https://api.stackexchange.com/) API (https://data.stackexchange.com/) Data (https://stackoverflow.blog/?blb=1) Blog (https://www.facebook.com/officialstackoverflow/) Facebook (https://twitter.com/stackoverflow) Twitter (https://linkedin.com/company/stack-overflow) LinkedIn (https://www.instagram.com/thestackoverflow) Instagram Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under (https://stackoverflow.com/help/licensing) CC BY-SA . rev 2025.4.29.25832 By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our (https://stackoverflow.com/legal/cookie-policy) Cookie Policy . Accept all cookies Necessary cookies only Customize settings