nginx resolver -- dns - Stack Overflow (https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (Stack Overflow) (/opensearch.xml) (https://stackoverflow.com/questions/49641685/nginx-resolver-dns) (https://cdn.sstatic.net/Shared/stacks.css?v=d6a266655a25) (https://cdn.sstatic.net/Sites/stackoverflow/primary.css?v=22fb2cb11723) (Feed for question 'nginx resolver -- dns') (/feeds/question/49641685) (https://cdn.sstatic.net/Shared/Channels/channels.css?v=5981bb1a5bd7) (https://accounts.google.com/gsi/style) (site logo) Join Stack Overflow By clicking “Sign up”, you agree to our (/legal/terms-of-service/public) terms of service and acknowledge you have read our (/legal/privacy-policy) privacy policy . (45fdb50b82cf09e3c22aa1697ef5a8ee0b8a220472cd062937b14b656f99cff0) (1) (2.0) Sign up with Google Sign up with GitHub OR (45fdb50b82cf09e3c22aa1697ef5a8ee0b8a220472cd062937b14b656f99cff0) (1) () () () () () () Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (/users/login) Log in (45fdb50b82cf09e3c22aa1697ef5a8ee0b8a220472cd062937b14b656f99cff0) () 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 (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams) Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising) Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai) OverflowAI GenAI features for Teams (https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api) OverflowAPI Train & fine-tune LLMs (https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs) Labs The future of collective knowledge sharing (https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) About the company (https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog) Visit the blog (Search…) () Loading… (https://stackoverflow.com) current community (https://stackoverflow.com) (Stack Overflow) Stack Overflow (https://stackoverflow.com/help) help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) chat (https://meta.stackoverflow.com) (Meta Stack Overflow) Meta Stack Overflow your communities (https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f49641685%2fnginx-resolver-dns) Sign up or (https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f49641685%2fnginx-resolver-dns) log in to customize your list. (https://stackexchange.com/sites) more stack exchange communities (https://stackoverflow.blog) company blog (Click to show search) (https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f49641685%2fnginx-resolver-dns) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f49641685%2fnginx-resolver-dns) 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) javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json python-3.x .net ruby-on-rails sql-server swift django angular objective-c excel pandas angularjs regex typescript ruby linux ajax iphone vba xml laravel spring asp.net-mvc database wordpress string flutter postgresql mongodb wpf windows amazon-web-services xcode bash git oracle-database spring-boot dataframe azure firebase list multithreading docker vb.net react-native eclipse algorithm powershell macos visual-studio numpy image forms scala function vue.js performance twitter-bootstrap selenium winforms kotlin loops express dart hibernate sqlite matlab python-2.7 shell rest apache entity-framework android-studio csv maven linq qt dictionary unit-testing asp.net-core facebook apache-spark tensorflow file swing class unity-game-engine sorting date authentication go symfony t-sql opencv matplotlib .htaccess google-chrome for-loop datetime codeigniter http perl validation sockets google-maps object uitableview xaml oop if-statement visual-studio-code cordova ubuntu web-services email android-layout github spring-mvc elasticsearch kubernetes selenium-webdriver ms-access user-interface parsing ggplot2 pointers google-sheets machine-learning c++11 security google-apps-script flask ruby-on-rails-3 templates nginx variables exception sql-server-2008 gradle debugging tkinter listview delphi jpa asynchronous web-scraping pdf haskell jsp ssl amazon-s3 google-cloud-platform jenkins testing xamarin wcf npm batch-file generics ionic-framework network-programming unix recursion google-app-engine mongoose visual-studio-2010 .net-core android-fragments assembly animation math next.js svg session hadoop intellij-idea curl django-models rust join winapi laravel-5 url heroku http-redirect tomcat google-cloud-firestore inheritance webpack keras image-processing gcc asp.net-mvc-4 logging dom swiftui web matrix pyspark actionscript-3 button post optimization firebase-realtime-database jquery-ui iis cocoa xpath d3.js javafx firefox internet-explorer xslt caching select asp.net-mvc-3 opengl events asp.net-web-api plot dplyr encryption magento search stored-procedures amazon-ec2 ruby-on-rails-4 memory audio canvas multidimensional-array jsf random vector redux cookies input facebook-graph-api flash xamarin.forms indexing arraylist ipad cocoa-touch data-structures video model-view-controller apache-kafka serialization jdbc woocommerce azure-devops routes razor awk servlets mod-rewrite beautifulsoup excel-formula docker-compose filter iframe aws-lambda design-patterns text django-rest-framework visual-c++ cakephp mobile android-intent react-hooks struct methods groovy mvvm ssh lambda checkbox ecmascript-6 google-chrome-extension time grails installation sharepoint cmake shiny spring-security jakarta-ee android-recyclerview plsql core-data types meteor android-activity sed bootstrap-4 websocket activerecord graph replace scikit-learn file-upload group-by vim junit boost deep-learning sass import memory-management error-handling async-await eloquent dynamic soap silverlight dependency-injection charts layout apache-spark-sql deployment browser gridview svn while-loop google-bigquery vuejs2 ffmpeg dll highcharts view foreach plugins makefile c#-4.0 redis reporting-services jupyter-notebook merge server unicode https reflection google-maps-api-3 twitter oauth-2.0 extjs pytorch axios terminal pip split cmd mysqli encoding django-views database-design automation collections hash netbeans build data-binding ember.js tcp sqlalchemy pdo apache-flex concurrency entity-framework-core command-line spring-data-jpa printing java-8 react-redux jestjs html-table service neo4j lua ansible material-ui parameters module enums flexbox visual-studio-2012 promise outlook firebase-authentication webview web-applications uwp jquery-mobile utf-8 datatable python-requests parallel-processing drop-down-menu colors scroll hive scipy tfs count syntax ms-word twitter-bootstrap-3 ssis google-analytics fonts three.js rxjs powerbi constructor graphql file-io paypal discord cassandra socket.io graphics compiler-errors gwt react-router solr nlp url-rewriting backbone.js memory-leaks datatables oauth terraform datagridview drupal oracle11g zend-framework neural-network knockout.js triggers django-forms interface google-api angular-material casting jmeter linked-list path proxy timer django-templates arduino directory orm parse-platform windows-phone-7 visual-studio-2015 cron push-notification conditional-statements primefaces functional-programming pagination model jar xamarin.android hyperlink uiview gitlab visual-studio-2013 vbscript google-cloud-functions azure-active-directory jwt download swift3 sql-server-2005 configuration process rspec pygame properties combobox callback windows-phone-8 linux-kernel safari scrapy permissions raspberry-pi scripting emacs clojure x86 scope io compilation mongodb-query responsive-design nhibernate expo angularjs-directive azure-functions request bluetooth dns 3d binding reference architecture playframework discord.js version-control pyqt doctrine-orm package get rubygems sql-server-2012 f# autocomplete openssl datepicker kendo-ui tree jackson controller yii nested grep xamarin.ios static dockerfile statistics null transactions pycharm datagrid active-directory uiviewcontroller webforms phpmyadmin discord.py notifications sas computer-vision duplicates mocking youtube nullpointerexception yaml menu sum bitmap blazor electron asp.net-mvc-5 visual-studio-2008 time-series yii2 jsf-2 css-selectors stl android-listview floating-point cryptography ant stream hashmap character-encoding msbuild sdk asp.net-core-mvc google-drive-api selenium-chromedriver jboss joomla cors navigation devise anaconda background camera multiprocessing binary pyqt5 cuda frontend linq-to-sql iterator mariadb onclick plotly ios7 rabbitmq android-jetpack-compose android-asynctask microsoft-graph-api tabs insert laravel-4 uicollectionview environment-variables amazon-dynamodb linker xsd console coldfusion upload continuous-integration ftp textview opengl-es vuejs3 operating-system mockito macros localization formatting xml-parsing json.net type-conversion kivy data.table timestamp calendar integer segmentation-fault android-ndk drag-and-drop prolog char crash jasmine automated-tests dependencies geometry android-gradle-plugin itext firebase-cloud-messaging header fortran sprite-kit mfc attributes nuxt.js azure-pipelines nosql format nestjs odoo db2 jquery-plugins jenkins-pipeline leaflet event-handling flutter-layout annotations postman julia keyboard textbox arm visual-studio-2017 gulp libgdx stripe-payments synchronization xampp timezone crystal-reports dom-events uikit azure-web-app-service android-emulator wso2 swagger sequelize.js namespaces uiscrollview aggregation-framework jvm google-sheets-formula chart.js com subprocess geolocation webdriver centos snowflake-cloud-data-platform html5-canvas garbage-collection widget dialog numbers concatenation sql-update qml set tuples windows-10 mapreduce java-stream smtp ionic2 rotation modal-dialog spring-data android-edittext http-headers doctrine nuget radio-button sonarqube grid lucene xmlhttprequest internationalization listbox initialization switch-statement components google-play apache-camel boolean serial-port ldap ios5 youtube-api gdb return latex pivot eclipse-plugin frameworks tags containers github-actions dataset asp-classic subquery foreign-keys label c++17 copy uinavigationcontroller delegates google-cloud-storage struts2 migration base64 protractor embedded find sql-server-2008-r2 queue uibutton arguments composer-php append jaxb zip stack cucumber autolayout ide entity-framework-6 popup iteration tailwind-css airflow windows-7 r-markdown ssl-certificate vb6 gmail hover jqgrid g++ range udp Next You’ll be prompted to create an account to view your personalized homepage. (/) Home (/questions) Questions (/tags) Tags (/beta/discussions) Discussions Labs (https://chat.stackoverflow.com/?tab=all&sort=active) Chat (/users) Users (/jobs?source=so-left-nav) Jobs (https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav) Companies Collectives Communities for your favorite technologies. (/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 Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact) Explore Teams Collectives™ on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. (/collectives) Learn more about Collectives Teams Q&A for work Connect and share knowledge within a single location that is structured and easy to search. (https://stackoverflow.co/teams/) Learn more about 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 downvote just yet. You'll need to complete a few actions and gain 125 reputation points before being able to downvote. Casting downvotes indicate issues with quality, effort, or accuracay of a post. (https://stackoverflow.com/help/whats-reputation) What's reputation and how do I get it? Instead, you can try suggesting an edit to improve the post. Suggest edit No thanks (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (/questions/49641685/nginx-resolver-dns) nginx resolver -- dns (/questions/ask) Ask Question (2018-04-04 02:11:38Z) Asked 7 years ago Modified (?lastactivity) (2021-12-08 18:22:44Z) 3 years, 4 months ago (Viewed 72,466 times) Viewed 72k times This question shows research effort; it is useful and clear (70:3:31e,16:b6ab0cce14e24866,10:1745103739,16:5756e9336cdc7520,8:49641685,c79086beca46cba49fdbcbe9781c6bbbcd5382c98f27da73fa16e23969659c3b) 30 (This question does not show any research effort; it is unclear or not useful) (70:3:31e,16:4785aa88e664fe6e,10:1745103739,16:41a11dfda3c8e8ff,8:49641685,a6659079cdd713c58e9726ad7efd109eebec51d80d2574bba402ed2131d0dcff) Save this question. (/posts/49641685/timeline) Show activity on this post. Please excuse a very beginner question. I'm having trouble understanding the nginx 'resolver' parameter and how it works. I have read the documentation, searched tutorials and posts (using keywords like resolver, nginx, and dns), and I'm still not sure how to apply resolver. (http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver) http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver "Configures name servers used to resolve names of upstream servers into addresses...." By this definition, it seems to be simply doing the nameserver's job. resolver ns1.myhost.com ns2.myhost.com; But the examples point to an internal/private IP address. "An address can be specified as a domain name or IP address, and an optional port...." This implies that I could resolver example.com www.example.com; (or resolver 12.34.56.78; ) but again, I see no such examples in the documentation. As a practical example, let's say — purely hypothetically :) — that I'm building a simple web server with a couple of server blocks on it. Do I set 'resolver' to the IP of the server itself? Or an internal IP in the server's LAN? The documentation seems to suggest an internal IP (127.x.x.x or 10.x.x.x) — but how to set/determine what that IP is? (/questions/tagged/nginx) (show questions tagged 'nginx') nginx (/questions/tagged/dns) (show questions tagged 'dns') dns (/questions/tagged/resolver) (show questions tagged 'resolver') resolver (/q/49641685) (Short permalink to this question) Share Share a link to this question Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/49641685/edit) () Improve this question Follow (70:3:31e,16:d6f7093444acf9b0,10:1745103739,16:d52afca4c902f72c,8:49641685,5c0dd482b46dba306abe21753961fe79e6d6d1bee67a6f92de36efa176d04d09) Follow this question to receive notifications (/posts/49641685/revisions) (show all edits to this post) edited (2019-06-26 16:54:36Z) Jun 26, 2019 at 16:54 (/users/1721265/guntbert) (guntbert's user avatar) (/users/1721265/guntbert) guntbert (reputation score) 536 (6 silver badges) 6 6 silver badges (19 bronze badges) 19 19 bronze badges asked (2018-04-04 02:11:38Z) Apr 4, 2018 at 2:11 (/users/8005942/geekomancer) (Geekomancer's user avatar) (/users/8005942/geekomancer) Geekomancer Geekomancer (reputation score) 489 (1 gold badge) 1 1 gold badge (4 silver badges) 4 4 silver badges (12 bronze badges) 12 12 bronze badges (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) Add a comment | (Expand to show all comments on this post) 3 Answers 3 Sorted by: (/questions/49641685/nginx-resolver-dns?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 (70:3:31e,16:795bb7e9f6363f46,10:1745103739,16:4a698572d46ab4f9,8:49642310,d7eebc1ac67627054d5d877a69ea33ccbebade818ce427ec5d09c218302f8916) 31 (This answer is not useful) (70:3:31e,16:4b0a9df3fdc744a1,10:1745103739,16:21a1c2ce107902a9,8:49642310,dad8c57f9d790e9864e1f120041aae41904f017f9393cc05a4ea8f704e664fa6) Save this answer. (Loading when this answer was accepted…) (/posts/49642310/timeline) Show activity on this post. Resolve means which DNS server nginx should refer to when it has to resolve an external url. If you have a config like below location / { proxy_pass http://www.example.com/abc/def; } Now by default nginx will pick your resolver from the host /etc/resolv.conf , but it may not be what you need. If you want to use the Google DNS resolver, then you will update your nginx config like below: location / { resolver 8.8.8.8; proxy_pass http://www.example.com/abc/def; } If you are using a local DNS resolver to route within your local network, then you may use something like below: location / { resolver 192.168.11.10; proxy_pass http://machineabc/abc/def; } (/a/49642310) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/49642310/edit) () Improve this answer Follow (70:3:31e,16:c10e628027190256,10:1745103739,16:b7df765b1f9cab9d,8:49642310,c4bb9e3d848931106ac7e5d42248000de326d92a899be60c6465bdaeb409ea61) Follow this answer to receive notifications (/posts/49642310/revisions) (show all edits to this post) edited (2021-12-08 18:22:44Z) Dec 8, 2021 at 18:22 (/users/7487335/josh-correia) (Josh Correia's user avatar) (/users/7487335/josh-correia) Josh Correia (reputation score) 4,363 (3 gold badges) 3 3 gold badges (42 silver badges) 42 42 silver badges (63 bronze badges) 63 63 bronze badges answered (2018-04-04 03:30:46Z) Apr 4, 2018 at 3:30 (/users/2830850/tarun-lalwani) (Tarun Lalwani's user avatar) (/users/2830850/tarun-lalwani) Tarun Lalwani Tarun Lalwani (reputation score 146,720) 147k (11 gold badges) 11 11 gold badges (213 silver badges) 213 213 silver badges (276 bronze badges) 276 276 bronze badges 1 (number of 'useful comment' votes received) 3 Note: If the host part of proxy_pass is defined statically (i.e. the host doesn't need to be looked up in a variable) as in the example proxy_pass http://machineabc/abc/def , then the host will be resolved once and that time will be during NGNIX startup/reload. See the answers on (https://serverfault.com/q/240476/203726) "How to force nginx to resolve DNS (of a dynamic hostname) everytime when doing proxy_pass?" on Server Fault for more details. – (/users/2732969/anon) (7,233 reputation) Anon Commented (2019-08-08 02:50:38Z, License: CC BY-SA 4.0) Aug 8, 2019 at 2:50 (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) This answer is useful (70:3:31e,16:e83f9e1a3229e423,10:1745103739,16:62b6ea51b4f593f0,8:51051679,bfa02f7cf150dd68e7e887672ab7f990d77e2dc480b44a799ec1dd30df6a9b53) 10 (This answer is not useful) (70:3:31e,16:2db7fa0266eb175f,10:1745103739,16:5b9198cd06b26837,8:51051679,6b85d826b38fa4c73126a47afe7bdfbc25cfda9c9d3741530cb7eb080efdb5a9) Save this answer. (Loading when this answer was accepted…) (/posts/51051679/timeline) Show activity on this post. "Resolver" parameter defines the location of DNS server that nginx must use in order to resolve the IP of the URL passed under proxy_pass; As explained by Tarun, by default nginx will pick your resolver from the host /etc/resolv.conf and once resolved, it will cache the IP. Resolver is mostly used in two cases:1. Either in a private network, to resolve the IP's that exist in your network. 2. Or used at a place where the IP of your proxy_pass or upstream location changes very frequently and you cannot rely upon nginx cached IP. In the example you specified, the resolver will be the IP of the DNS server that could resolve your location. This could be either of : 1) 127.0.0.1 : If the web server itself is a DNS server, for this you need to setup DNS server on port 53(default) of this server. 2) x.x.x.x : The IP of the DNS server hosted in, either in your private network or any public DNS server if your URL's are publicly accessible. One may use 8.8.8.8 (Google's public DNS server). 3) You specified 10.x.x.x : Assuming that you were referring the AWS documentation. If not, in general, 10.x.x.x again needs to be a DNS server IP, which in case of AWS is 10.0.0.2. AWS reserves a few IP's of its VPC's and the second IP x.x.x.2 is reserved for DNS server. Note that in case your VPC is not 10.0.0.0/16, this IP will change accordingly. Eg: Lets say your VPC is 10.192.0.0/16, then you will be using 10.192.0.2 as resolver. For above ref to (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html (https://www.jethrocarr.com/2013/11/02/nginx-reverse-proxies-and-dns-resolution/) https://www.jethrocarr.com/2013/11/02/nginx-reverse-proxies-and-dns-resolution/ (/a/51051679) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/51051679/edit) () Improve this answer Follow (70:3:31e,16:bb452f16ce87735b,10:1745103739,16:30a69f1be917412d,8:51051679,ed98a338a9fa1ae509d0b9959a30e0b9c1b131ab392b21c7ac32c25ce0ea0c51) Follow this answer to receive notifications answered (2018-06-26 21:35:31Z) Jun 26, 2018 at 21:35 (/users/9675043/nishith-kulshrestha) (Nishith Kulshrestha's user avatar) (/users/9675043/nishith-kulshrestha) Nishith Kulshrestha Nishith Kulshrestha (reputation score) 146 (1 silver badge) 1 1 silver badge (4 bronze badges) 4 4 bronze badges (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) This answer is useful (70:3:31e,16:c19df47d1ac061a6,10:1745103739,16:cd6776984d2227d0,8:64461780,d2e8663145ce125c38a58614caea6dfac2c84dcf96ef8bb535c95ee868ae4447) -2 (This answer is not useful) (70:3:31e,16:419b6336d9bfd4f7,10:1745103739,16:99d3c9821f56fd33,8:64461780,5d9eb79bdc9ea71984f40f062c1358b8318a2667f491a63cfae26088dfb6455f) Save this answer. (Loading when this answer was accepted…) (/posts/64461780/timeline) Show activity on this post. There is another way to make this, if you want to set manually the resolution, without using external tools like bind9 or dnsmasq location / { set $upstream 12.34.56.78; # desired IP resolution proxy_pass http://$upstream:8080; # desired port proxy_set_header Host example.com; # desired host } (/a/64461780) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/64461780/edit) () Improve this answer Follow (70:3:31e,16:53ccb776f8eda6ae,10:1745103739,16:ee64f7620409d6b8,8:64461780,668e045a9fe79bdeaff3bd4e499f20aee3f36b35f4de35d63016de01f7bda8f4) Follow this answer to receive notifications answered (2020-10-21 10:37:00Z) Oct 21, 2020 at 10:37 (/users/2249359/hayashi) (Hayashi's user avatar) (/users/2249359/hayashi) Hayashi Hayashi (reputation score) 1 1 (number of 'useful comment' votes received) 2 This is irrelevant for the asked question, and better done with upstream backend { server 12.34.56.78; } because rewrite module directives (set) are known to produce unexpected behavior in more complex cases. – (/users/73957/temoto) (5,587 reputation) temoto Commented (2020-11-04 12:31:56Z, License: CC BY-SA 4.0) Nov 4, 2020 at 12:31 (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) (49641685) (false) () (0) Your Answer (True) Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question . Provide details and share your research! But avoid … Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our (/help/how-to-answer) tips on writing great answers . Draft saved Draft discarded (45fdb50b82cf09e3c22aa1697ef5a8ee0b8a220472cd062937b14b656f99cff0) Sign up or (/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f49641685%2fnginx-resolver-dns%23new-answer) log in Sign up using Google Sign up using Email and Password (false) (false) 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 .(1) Start asking to get answers Find the answer to your question by asking. (/questions/ask) Ask question Explore related questions (/questions/tagged/nginx) (show questions tagged 'nginx') nginx (/questions/tagged/dns) (show questions tagged 'dns') dns (/questions/tagged/resolver) (show questions tagged 'resolver') resolver See similar questions with these tags. The Overflow Blog (https://stackoverflow.blog/2025/04/17/wait-what-is-agentic-ai/?cb=1) Wait, what is agentic AI? (https://stackoverflow.blog/2025/04/18/generating-components-not-tokens/?cb=1) Generating components, not tokens Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/407927/changes-to-reporting-for-the-status-review-escalation-process?cb=1) Changes to reporting for the [status-review] escalation process (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/433466/a-discussion-about-closed-and-potentially-useful-posts-on-stack-overflow?cb=1) A discussion about closed (and potentially useful) posts on Stack Overflow (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 Linked (https://stackoverflow.com/q/76030789?lq=1) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/76030789/nginx-emerg-duplicate-location-in-etc-nginx-sites-enabled-example-com20?noredirect=1&lq=1) nginx: [emerg] duplicate location "/" in /etc/nginx/sites-enabled/example.com:20 Related (https://stackoverflow.com/q/20583364?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/20583364/how-to-connect-to-nginx?rq=3) How to connect to nginx? (https://stackoverflow.com/q/35744650?rq=3) (Question score (upvotes - downvotes)) 113 (https://stackoverflow.com/questions/35744650/docker-network-nginx-resolver?rq=3) Docker Network Nginx Resolver (https://stackoverflow.com/q/39421748?rq=3) (Question score (upvotes - downvotes)) 12 (https://stackoverflow.com/questions/39421748/nginx-keepalive-and-dns-resolver?rq=3) nginx keepalive and dns resolver (https://stackoverflow.com/q/40330704?rq=3) (Question score (upvotes - downvotes)) 46 (https://stackoverflow.com/questions/40330704/what-does-the-resolver-parameter-in-nginx-do?rq=3) What does the "resolver" parameter in nginx do? (https://stackoverflow.com/q/44438616?rq=3) (Question score (upvotes - downvotes)) 11 (https://stackoverflow.com/questions/44438616/how-does-nginx-picks-a-resolver-when-there-are-multiple-defined?rq=3) how does nginx picks a resolver when there are multiple defined? (https://stackoverflow.com/q/51777008?rq=3) (Question score (upvotes - downvotes)) 4 (https://stackoverflow.com/questions/51777008/how-to-manage-angular-resolvers-in-an-ngrx-environment?rq=3) How to manage Angular resolvers in an ngrx environment (https://stackoverflow.com/q/56486489?rq=3) (Question score (upvotes - downvotes)) 9 (https://stackoverflow.com/questions/56486489/nginx-caching-dns-look-ups-and-ignoring-my-resolver-settings?rq=3) Nginx caching DNS look ups and ignoring my resolver settings (https://stackoverflow.com/q/57812097?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/57812097/nginx-configuration-resolver-not-working-for-local-host?rq=3) NGINX configuration resolver not working for local host (https://stackoverflow.com/q/60936400?rq=3) (Question score (upvotes - downvotes)) 5 (https://stackoverflow.com/questions/60936400/how-to-make-nginx-re-resolve-dns?rq=3) How to make NGINX re-resolve DNS? (https://stackoverflow.com/q/67439712?rq=3) (Question score (upvotes - downvotes)) 19 (https://stackoverflow.com/questions/67439712/nginx-does-not-re-resolve-dns-names-in-docker?rq=3) Nginx does not re-resolve DNS names in Docker (https://stackexchange.com/questions?tab=hot) Hot Network Questions (Unix & Linux Stack Exchange) (https://unix.stackexchange.com/questions/793888/fork-causes-dma-buffer-in-physical-memory-to-retain-stale-data-on-subsequent-w) fork() Causes DMA Buffer in Physical Memory to Retain Stale Data on Subsequent Writes (Physics Stack Exchange) (https://physics.stackexchange.com/questions/848053/sabine-hossenfelder-and-the-meaning-of-acceleration) Sabine Hossenfelder and the meaning of acceleration (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/265939/can-opposite-chirality-organisms-coexist-on-a-klein-bottle-world-without-unstopp) Can opposite-chirality organisms coexist on a Klein bottle world without unstoppable disease? (Personal Finance & Money Stack Exchange) (https://money.stackexchange.com/questions/165848/are-these-carfax-items-red-flags-when-buying-used-car-from-a-dealer) Are these carfax items red flags when buying used car from a dealer? (MathOverflow) (https://mathoverflow.net/questions/491284/on-the-number-of-products-of-consecutive-integers-which-are-equal-1-modulo-prime) On the number of products of consecutive integers which are equal 1 modulo prime (Physics Stack Exchange) (https://physics.stackexchange.com/questions/848045/does-the-structure-of-the-laws-of-physics-allow-for-the-discovery-of-a-5th-funda) Does the structure of the laws of physics allow for the discovery of a 5th fundamental force? (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/741078/align-array-elements-by-ones-digit) Align array elements by ones digit (Mathematica Stack Exchange) (https://mathematica.stackexchange.com/questions/312243/how-can-i-draw-union-of-two-cylinders-like-this) How can I draw Union of two cylinders like this? (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/296072/a-space-opera-where-it-was-almost-impossible-to-commit-treason-against-the-galac) A space opera where it was almost impossible to commit treason against the Galactic Empire (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/296111/which-superman-media-or-variants-are-associated-with-the-logos-shown-in-dc-comic) Which Superman media or variants are associated with the logos shown in DC Comics Germany’s Superman Day TikTok video? (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/131539/magic-fifteen-who-wins-the-race-to-15) Magic fifteen. Who wins the race to 15? (Philosophy Stack Exchange) (https://philosophy.stackexchange.com/questions/124369/what-does-meaning-mean-for-dummet) What does "meaning" mean for Dummet? (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/744270/bjt-switch-from-power-perspective) BJT switch from power perspective (Personal Finance & Money Stack Exchange) (https://money.stackexchange.com/questions/165853/bluebird-card-and-account) Bluebird card and account (Database Administrators Stack Exchange) (https://dba.stackexchange.com/questions/346217/is-there-a-meaningful-explanation-for-this-weird-postgresql-behaviour-of-the-cha) Is there a meaningful explanation for this weird PostgreSQL behaviour of the char datatype? (Mathematica Stack Exchange) (https://mathematica.stackexchange.com/questions/312231/how-can-i-get-rid-off-unexpected-holes-appear-on-contourplot) How can I get rid off unexpected holes appear on ContourPlot? (Cross Validated) (https://stats.stackexchange.com/questions/664410/correct-interpretation-of-an-estimate-which-is-outside-its-confidence-limits) Correct interpretation of an estimate which is outside its confidence limits (Physics Stack Exchange) (https://physics.stackexchange.com/questions/848056/at-what-depth-does-it-become-impossible-to-urinate-because-of-water-pressure) At what depth does it become impossible to urinate? (Because of water pressure) (Blender Stack Exchange) (https://blender.stackexchange.com/questions/333677/how-do-i-delete-only-one-overlapping-point-instance-instead-of-both) How do I delete only one overlapping point/instance instead of both? (Code Review Stack Exchange) (https://codereview.stackexchange.com/questions/295909/desperately-seeking-a-hashing-function) Desperately seeking a hashing function (Mathematics Stack Exchange) (https://math.stackexchange.com/questions/5057541/algebraic-torus-and-generic-points) Algebraic torus and generic points (Travel Stack Exchange) (https://travel.stackexchange.com/questions/194974/my-name-has-a-non-english-character-will-identity-check-by-a-human-always-be-r) My name has a non English character - will identity check by a human always be required? (Mi Yodeya) (https://judaism.stackexchange.com/questions/148942/what-is-%d7%a1%d6%b4%d7%a4%d6%b0%d7%a8%d6%b8%d7%90-%d7%93%d6%bc%d6%b0%d7%90%d6%b8%d7%93%d6%b8%d7%9d-%d7%a7%d6%b7%d7%93%d6%b0%d7%9e%d6%b8%d7%90%d6%b8%d7%94-quoted-in-the-zohar) What is סִפְרָא דְּאָדָם קַדְמָאָה quoted in the Zohar? (MathOverflow) (https://mathoverflow.net/questions/491226/reference-request-of-quote-about-gromov) Reference request of quote about Gromov (/feeds/question/49641685) (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/49641685) () (https://stackoverflow.com) (https://stackoverflow.com) Stack Overflow (/questions) Questions (/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 (/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.17.25340