nginx location 404 not found - 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/41099318/nginx-location-404-not-found) (Feed for question 'nginx location 404 not found') (https://stackoverflow.com/feeds/question/41099318) (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%2f41099318%2fnginx-location-404-not-found) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f41099318%2fnginx-location-404-not-found) 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 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 (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. nginx location http-status-code-404 nginx-location nginx-config Find related question Not now (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://stackoverflow.com/questions/41099318/nginx-location-404-not-found) nginx location 404 not found (https://stackoverflow.com/questions/ask) Ask Question (2016-12-12 10:58:28Z) Asked 8 years, 4 months ago Modified (https://stackoverflow.com/questions/41099318/nginx-location-404-not-found?lastactivity) (2023-11-11 09:42:20Z) 1 year, 5 months ago (Viewed 234,022 times) Viewed 234k times This question shows research effort; it is useful and clear 26 (This question does not show any research effort; it is unclear or not useful) Save this question. (https://stackoverflow.com/posts/41099318/timeline) Show activity on this post. Here are my nginx configure files. On the default.conf, the first location is used to access /usr/share/nginx/html directory, it is ok while I access (http://47.91.152.99/) http://47.91.152.99 . But when I add up a new location for directory /usr/share/nginx/public directory, nginx return me a 404 page while I access (http://47.91.152.99/test) http://47.91.152.99/test . So, what is the matter? Am I misuse the directive of nginx? /etc/nginx/nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; } /etc/nginx/conf.d/default.conf server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } location ^~ /test/ { root /usr/share/nginx/public; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } (https://stackoverflow.com/questions/tagged/nginx) (show questions tagged 'nginx') nginx (https://stackoverflow.com/questions/tagged/location) (show questions tagged 'location') location (https://stackoverflow.com/questions/tagged/http-status-code-404) (show questions tagged 'http-status-code-404') http-status-code-404 (https://stackoverflow.com/questions/tagged/nginx-location) (show questions tagged 'nginx-location') nginx-location (https://stackoverflow.com/questions/tagged/nginx-config) (show questions tagged 'nginx-config') nginx-config (https://stackoverflow.com/q/41099318) (Short permalink to this question) Share (https://stackoverflow.com/posts/41099318/edit) Improve this question Follow Follow this question to receive notifications (https://stackoverflow.com/posts/41099318/revisions) (show all edits to this post) edited (2020-09-01 07:30:46Z) Sep 1, 2020 at 7:30 (https://stackoverflow.com/users/9431571/boaventura) (Boaventura's user avatar) (https://stackoverflow.com/users/9431571/boaventura) Boaventura (reputation score) 1,409 (1 gold badge) 1 1 gold badge (12 silver badges) 12 12 silver badges (31 bronze badges) 31 31 bronze badges asked (2016-12-12 10:58:28Z) Dec 12, 2016 at 10:58 (https://stackoverflow.com/users/2438940/jamesxu-e-g) (jamesxu-e.g.'s user avatar) (https://stackoverflow.com/users/2438940/jamesxu-e-g) jamesxu-e.g. jamesxu-e.g. (reputation score) 650 (2 gold badges) 2 2 gold badges (10 silver badges) 10 10 silver badges (23 bronze badges) 23 23 bronze badges 4 Do you mean http://47.91.152.99/test/ (with a trailing / )? Is the file located at /usr/share/nginx/public/test/index.html ? – (https://stackoverflow.com/users/4862445/richard-smith) (50,007 reputation) Richard Smith Commented (2016-12-12 12:24:36Z, License: CC BY-SA 3.0) Dec 12, 2016 at 12:24 Yes, with a trailing /. And index.html is in the directotry. – (https://stackoverflow.com/users/2438940/jamesxu-e-g) (650 reputation) jamesxu-e.g. Commented (2016-12-13 12:51:20Z, License: CC BY-SA 3.0) Dec 13, 2016 at 12:51 index.html is in which directory? Your question implies /usr/share/nginx/public , but your configuration file uses /usr/share/nginx/public/test – (https://stackoverflow.com/users/4862445/richard-smith) (50,007 reputation) Richard Smith Commented (2016-12-13 12:56:04Z, License: CC BY-SA 3.0) Dec 13, 2016 at 12:56 The reason is you set your Debug to False, so you won't see the response from (http://47.91.152.99/) 47.91.152.99 . If you would like to see the response from (http://47.91.152.99/) 47.91.152.99 set your Debug to True – (https://stackoverflow.com/users/12499550/teshie-ethiopia) (666 reputation) Teshie Ethiopia Commented (2023-07-21 07:11:58Z, License: CC BY-SA 4.0) Jul 21, 2023 at 7:11 (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) 7 Answers 7 Sorted by: (https://stackoverflow.com/questions/41099318/nginx-location-404-not-found?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 42 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/41101487/timeline) Show activity on this post. You seem to be misusing the (https://nginx.org/en/docs/http/ngx_http_core_module.html#root) root directive in the following block; location ^~ /test/ { root /usr/share/nginx/public; index index.html index.htm; } The previous block, as you use it, is telling nginx to look for directory test into the folder /usr/share/nginx/public . If there's no accessible test folder at that location, nginx will return a 404. To solve this problem, i suggest using (https://nginx.org/en/docs/http/ngx_http_core_module.html#alias) alias instead of (https://nginx.org/en/docs/http/ngx_http_core_module.html#root) root directive, like so; location ^~ /test/ { alias /usr/share/nginx/public; index index.html index.htm; } In this block, which uses (https://nginx.org/en/docs/http/ngx_http_core_module.html#alias) alias instead of (https://nginx.org/en/docs/http/ngx_http_core_module.html#root) root directive, a request for domain.com/test/somefile.jpg would look for file somefile.jpg into /usr/share/nginx/public . Look for more information on (https://nginx.org/en/docs/http/ngx_http_core_module.html#alias) alias directive on nginx.org Also, just for kicks, (https://nginx.org/en/docs/http/ngx_http_index_module.html) index directive can be set generally so you don't have to re-write it all the time, like so; server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html index.htm; error_page 500 502 503 504 /50x.html; location / { } location ~^/test/ { alias /usr/share/nginx/public; } location = /50x.html { root /usr/share/nginx/html; } } One thing you should also consider... the more 'precise' the location block, the higher in your config it should reside. Like that location = /50x.html . In a perfect world, that would be set up top, right after the general server block settings. Hope it helps. (https://stackoverflow.com/a/41101487) (Short permalink to this answer) Share (https://stackoverflow.com/posts/41101487/edit) Improve this answer Follow Follow this answer to receive notifications (https://stackoverflow.com/posts/41101487/revisions) (show all edits to this post) edited (2023-11-11 09:42:20Z) Nov 11, 2023 at 9:42 answered (2016-12-12 12:59:50Z) Dec 12, 2016 at 12:59 (https://stackoverflow.com/users/7120073/oldfart) (OldFart's user avatar) (https://stackoverflow.com/users/7120073/oldfart) OldFart OldFart (reputation score) 1,731 (14 silver badges) 14 14 silver badges (22 bronze badges) 22 22 bronze badges 4 (number of 'useful comment' votes received) 3 It doesn't work. I still get the 404 not found response. – (https://stackoverflow.com/users/2438940/jamesxu-e-g) (650 reputation) jamesxu-e.g. Commented (2016-12-13 13:05:12Z, License: CC BY-SA 3.0) Dec 13, 2016 at 13:05 When access the url (http://47.91.152.99/test) 47.91.152.99/test , I want nginx server access the root directory /usr/share/nginx/public. – (https://stackoverflow.com/users/2438940/jamesxu-e-g) (650 reputation) jamesxu-e.g. Commented (2016-12-13 13:14:52Z, License: CC BY-SA 3.0) Dec 13, 2016 at 13:14 It will be a match for requests starting with /images/ (location / also matches such requests, but has shorter prefix). The resulting configuration of the server block should look like this: server { location / { root /data/www; } location /images/ { root /data; } } – (https://stackoverflow.com/users/2438940/jamesxu-e-g) (650 reputation) jamesxu-e.g. Commented (2016-12-13 13:18:37Z, License: CC BY-SA 3.0) Dec 13, 2016 at 13:18 (number of 'useful comment' votes received) 2 After I create test directory under /usr/share/nginx/public, then the response is okay. Thank you for you reply. – (https://stackoverflow.com/users/2438940/jamesxu-e-g) (650 reputation) jamesxu-e.g. Commented (2016-12-13 13:27:06Z, License: CC BY-SA 3.0) Dec 13, 2016 at 13:27 (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 15 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/53247287/timeline) Show activity on this post. Error caused by root directive location ^~ /test/ { root /usr/share/nginx/public; index index.html index.htm; } Fix with alias directive location ^~ /test/ { alias /usr/share/nginx/public; index index.html index.htm; } Other Improvements Extra tip: the index directive can be set so that you don't have to re-write it. server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html index.htm; error_page 500 502 503 504 /50x.html; location / { } location ~^/test/ { alias /usr/share/nginx/public; } location = /50x.html { root /usr/share/nginx/html; } } nginx matches Location blocks partly based on position in the config. Ideally, you would invert what you have now. The location block would be higher in nginx config. To that end, the location = /50x.html would also move up. Order is Exact match = Forward match ^~ / Case sensitive regex ~ / Case insensitive regex ~* Path match / More about (https://stackoverflow.com/questions/5238377/nginx-location-priority) nginx location priority . Also, you can always review the official documentation. The nginx documentation for location block (http://nginx.org/en/docs/http/ngx_http_core_module.html#location) http://nginx.org/en/docs/http/ngx_http_core_module.html#location (https://stackoverflow.com/a/53247287) (Short permalink to this answer) Share (https://stackoverflow.com/posts/53247287/edit) Improve this answer Follow Follow this answer to receive notifications answered (2018-11-11 09:11:02Z) Nov 11, 2018 at 9:11 (https://stackoverflow.com/users/775686/gtzilla) (gtzilla's user avatar) (https://stackoverflow.com/users/775686/gtzilla) gtzilla gtzilla (reputation score) 1,315 (1 gold badge) 1 1 gold badge (16 silver badges) 16 16 silver badges (22 bronze badges) 22 22 bronze badges 1 Moderator comment: "This edit was intended to address the author of the post and makes no sense as an edit. It should have been written as a comment or an answer." Comment wasn't long enough. What would you have preferred? – (https://stackoverflow.com/users/775686/gtzilla) (1,315 reputation) gtzilla Commented (2018-11-30 16:52:13Z, License: CC BY-SA 4.0) Nov 30, 2018 at 16:52 (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 1 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/62515742/timeline) Show activity on this post. when your app is vuejs,you need write like this,can prevent 404,pay attention to double /test/ location ^~/test/ { alias /usr/local/soft/vuejs/; try_files $uri $uri/ /test/index.html; } (https://stackoverflow.com/a/62515742) (Short permalink to this answer) Share (https://stackoverflow.com/posts/62515742/edit) Improve this answer Follow Follow this answer to receive notifications answered (2020-06-22 13:36:41Z) Jun 22, 2020 at 13:36 (https://stackoverflow.com/users/1879111/yongfa365) (yongfa365's user avatar) (https://stackoverflow.com/users/1879111/yongfa365) yongfa365 yongfa365 (reputation score) 352 (3 silver badges) 3 3 silver badges (7 bronze badges) 7 7 bronze badges 1 there is not alot of value added here. Specially with using such a bloating try_files directive. $uri and $uri/ are already beeing seen and dealt with by nginx nature so nothing useful in using this. In the same respect, having index.html with the same path as the location block makes no sens and again, is something that the 'index' directive takes care of without the need to explicitly repeat it. There is no harm in doing it, per say, but certainly doesnt help anyone understand the concepts as a whole. – (https://stackoverflow.com/users/7120073/oldfart) (1,731 reputation) OldFart Commented (2022-05-18 02:24:13Z, License: CC BY-SA 4.0) May 18, 2022 at 2:24 (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 1 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/69513773/timeline) Show activity on this post. I just solved this (index.html not found) issue. For me, I misstyped my project name to match your ec2 project name with the nginx path. Move to nginx/sites-enabled to check nginx path cd /etc/nginx/sites-enabled cat your_project_name Check your nginx path (for me : root/home/ubuntu/practice /current/public;) Move to home directory to check your project name4. cd5. ls6. If your ec2 project name(for me: practice) is not match with your nginx path name(for me: practice) then you might got "index.html not found error" (https://stackoverflow.com/a/69513773) (Short permalink to this answer) Share (https://stackoverflow.com/posts/69513773/edit) Improve this answer Follow Follow this answer to receive notifications (https://stackoverflow.com/posts/69513773/revisions) (show all edits to this post) edited (2021-10-10 09:45:16Z) Oct 10, 2021 at 9:45 (https://stackoverflow.com/users/446477/ouflak) (ouflak's user avatar) (https://stackoverflow.com/users/446477/ouflak) ouflak (reputation score) 2,523 (10 gold badges) 10 10 gold badges (45 silver badges) 45 45 silver badges (52 bronze badges) 52 52 bronze badges answered (2021-10-10 09:02:18Z) Oct 10, 2021 at 9:02 (https://stackoverflow.com/users/12036755/%ea%b8%b0%ec%9e%ac%eb%af%bc) (기재민's user avatar) (https://stackoverflow.com/users/12036755/%ea%b8%b0%ec%9e%ac%eb%af%bc) 기재민 기재민 (reputation score) 21 (5 bronze badges) 5 5 bronze badges 2 I must stress that the 'site-enabled' and disabled directory format comes from Apache httpd and is usually found on Debian and similar distrubutions. A native nginx distributed package does NOT include such directories. Also, it is of note that wherever you put your configuration files, nginx.conf must have the needed 'include' directive in order to process it. – (https://stackoverflow.com/users/7120073/oldfart) (1,731 reputation) OldFart Commented (2022-05-18 02:18:18Z, License: CC BY-SA 4.0) May 18, 2022 at 2:18 This looks more like a general, very basic tutorial in using a keyboard, legacy tools and proper 'grammar' related to the environment – (https://stackoverflow.com/users/7120073/oldfart) (1,731 reputation) OldFart Commented (2022-05-18 02:29:32Z, License: CC BY-SA 4.0) May 18, 2022 at 2:29 (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 0 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/69535054/timeline) Show activity on this post. and my server-blocks.conf server { listen 80; index index.html index.htm index.nginx-debian.html; server_name 13.xxx.xxx.xx; location / { root /var/www/portaladmin/; proxy_pass http://13.xxx.xxx.xx:80/; } error_log /var/log/nginx/portaladmin-erorr.log; } and my load-balancer.conf server { listen 80; server_name xx.xxx.xxx.xx access_log /home/ec2-user/logs/lb-access.log; error_log /home/ec2-user/logs/lb-error.log; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://13.xxx.xxx.xx:80; } } (https://stackoverflow.com/a/69535054) (Short permalink to this answer) Share (https://stackoverflow.com/posts/69535054/edit) Improve this answer Follow Follow this answer to receive notifications answered (2021-10-12 04:23:23Z) Oct 12, 2021 at 4:23 (https://stackoverflow.com/users/16747945/reyyzzy) (Reyyzzy's user avatar) (https://stackoverflow.com/users/16747945/reyyzzy) Reyyzzy Reyyzzy (reputation score) 1 (1 bronze badge) 1 1 bronze badge 1 As it’s currently written, your answer is unclear. Please (https://stackoverflow.com/posts/69535054/edit) edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers (https://stackoverflow.com/help/how-to-answer) in the help center . – (https://stackoverflow.com/users/-1/community) (1 reputation) Community (Community Bot — not a real person. Replies to this bot are not monitored.) Bot Commented (2021-10-12 05:19:53Z, License: CC BY-SA 4.0) Oct 12, 2021 at 5:19 (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 0 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/73325171/timeline) Show activity on this post. Creating nginx & sftp pods using Kubernetes.. I've found that the mountPath in my sftp-deployment.yaml file is related to the username in my sftp-server . And the error has happened when I have changed the username without changing mountPath value to match my username. So, the files were uploading to '/home/old-username' instead of '/home/new-username' . (https://stackoverflow.com/a/73325171) (Short permalink to this answer) Share (https://stackoverflow.com/posts/73325171/edit) Improve this answer Follow Follow this answer to receive notifications answered (2022-08-11 18:12:20Z) Aug 11, 2022 at 18:12 (https://stackoverflow.com/users/3999660/mohammad-tbeishat) (Mohammad Tbeishat's user avatar) (https://stackoverflow.com/users/3999660/mohammad-tbeishat) Mohammad Tbeishat Mohammad Tbeishat (reputation score) 1,076 (8 silver badges) 8 8 silver badges (17 bronze badges) 17 17 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 0 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/77408922/timeline) Show activity on this post. cd /etc/nginx/sites-available/ sudo nano default in this config file in https or server $url /$url /index.html (https://stackoverflow.com/a/77408922) (Short permalink to this answer) Share (https://stackoverflow.com/posts/77408922/edit) Improve this answer Follow Follow this answer to receive notifications answered (2023-11-02 10:42:08Z) Nov 2, 2023 at 10:42 (https://stackoverflow.com/users/10345087/nsubhadipta) (nsubhadipta's user avatar) (https://stackoverflow.com/users/10345087/nsubhadipta) nsubhadipta nsubhadipta (reputation score) 49 (1 silver badge) 1 1 silver badge (7 bronze badges) 7 7 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) Your Answer Draft saved Draft discarded Sign up or (https://stackoverflow.com/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f41099318%2fnginx-location-404-not-found%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/nginx) (show questions tagged 'nginx') nginx (https://stackoverflow.com/questions/tagged/location) (show questions tagged 'location') location (https://stackoverflow.com/questions/tagged/http-status-code-404) (show questions tagged 'http-status-code-404') http-status-code-404 (https://stackoverflow.com/questions/tagged/nginx-location) (show questions tagged 'nginx-location') nginx-location (https://stackoverflow.com/questions/tagged/nginx-config) (show questions tagged 'nginx-config') nginx-config 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 Linked (https://stackoverflow.com/q/5238377?lq=1) (Question score (upvotes - downvotes)) 339 (https://stackoverflow.com/questions/5238377/nginx-location-priority?noredirect=1&lq=1) Nginx location priority (https://stackoverflow.com/q/60451056?lq=1) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/60451056/how-to-point-nginx-to-my-index-html-location?noredirect=1&lq=1) How to point nginx to my index.html location? Related (https://stackoverflow.com/q/37975285?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/37975285/404-not-found-when-using-nginx-web-server?rq=3) 404 Not Found when using Nginx Web Server (https://stackoverflow.com/q/38539175?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/38539175/why-additional-location-in-nginx-conf-returns-404-code?rq=3) Why additional location in nginx conf returns 404 code? (https://stackoverflow.com/q/38922689?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/38922689/nginx-config-not-working?rq=3) NGINX config not working (https://stackoverflow.com/q/46845334?rq=3) (Question score (upvotes - downvotes)) 2 (https://stackoverflow.com/questions/46845334/why-nginx-location-returns-404-error?rq=3) why nginx location returns 404 error? (https://stackoverflow.com/q/52738581?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/52738581/nginx-try-files-doesnt-work-404-cannot-load-files?rq=3) Nginx try_files doesn't work 404, cannot load files (https://stackoverflow.com/q/55347572?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/55347572/nginx-returning-404-on-ubuntu?rq=3) Nginx returning 404 on Ubuntu? (https://stackoverflow.com/q/55387996?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/55387996/nginx-fails-to-load-site?rq=3) NGINX fails to load site (https://stackoverflow.com/q/58621603?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/58621603/nginx-location-trouble?rq=3) Nginx location trouble (https://stackoverflow.com/q/60057056?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/60057056/location-ignored-in-nginx?rq=3) Location ignored in nginx (https://stackoverflow.com/q/71240834?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/71240834/404-not-found-when-trying-to-change-nginx-webserver-location?rq=3) 404 not found when trying to change nginx webserver location (https://stackexchange.com/questions?tab=hot) Hot Network Questions (Philosophy Stack Exchange) (https://philosophy.stackexchange.com/questions/124597/physics-equations-with-universal-meaning-possible) Physics equations with universal meaning possible? (Network Engineering Stack Exchange) (https://networkengineering.stackexchange.com/questions/87121/pfsense-router-nat-redirection-not-working) Pfsense router NAT Redirection not working (Travel Stack Exchange) (https://travel.stackexchange.com/questions/195484/ota-took-our-money-but-wont-give-confirmation-for-my-flight-until-24-hrs-before) OTA took our money but won't give confirmation for my flight until 24 hrs before (Stack Overflow) (https://stackoverflow.com/questions/79598477/annotating-intentional-infinite-loop-to-satisfy-fanalyzer) Annotating intentional infinite loop to satisfy "-fanalyzer" (Home Improvement Stack Exchange) (https://diy.stackexchange.com/questions/317417/using-standard-ac-fixtures-for-dc-applications) Using standard AC fixtures for DC applications (History Stack Exchange) (https://history.stackexchange.com/questions/77735/why-did-germany-allow-and-help-introduce-the-deutsche-mark-to-montenegro) Why did Germany allow and help introduce the Deutsche Mark to Montenegro? (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/266122/how-to-convincingly-erase-a-populations-memory) How to convincingly erase a population's memory? (Politics Stack Exchange) (https://politics.stackexchange.com/questions/91557/in-canadas-2025-election-what-have-either-poilievre-or-carney-as-candidates-f) In Canada's 2025 election, what have either Poilievre or Carney, as candidates for Prime Minister, said about balancing the budget? (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? (Super User) (https://superuser.com/questions/1894874/how-to-identify-which-usb-device-is-failing) How to identify which USB device is failing (Blender Stack Exchange) (https://blender.stackexchange.com/questions/333965/why-my-objects-stops-moving) Why my objects stops moving? (Database Administrators Stack Exchange) (https://dba.stackexchange.com/questions/346327/how-does-sql-server-maintain-rowcount-metadata) How does SQL Server maintain rowcount metadata? (Role-playing Games Stack Exchange) (https://rpg.stackexchange.com/questions/215391/what-is-the-spell-attack-modifier-for-this-casterless-bigbys-hand-spell-from-th) What is the spell attack modifier for this casterless Bigby's Hand spell from the Waterdeep: Dungeon of the Mad Mage published adventure? (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/296286/in-st-tng-6x25-timescape-what-happens-to-the-romulan-ship) In ST: TNG 6x25, "Timescape", what happens to the Romulan ship? (Chemistry Stack Exchange) (https://chemistry.stackexchange.com/questions/188543/are-molecules-in-a-mixture-chemically-bonded) Are molecules in a mixture chemically bonded? (Mi Yodeya) (https://judaism.stackexchange.com/questions/149189/integrating-talmudic-reasoning-into-thought-process) Integrating Talmudic Reasoning into thought process (Quantum Computing Stack Exchange) (https://quantumcomputing.stackexchange.com/questions/41754/collision-probability-of-reduced-density-matrix-of-a-haar-random-state) Collision probability of reduced density matrix of a Haar random state (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? (Gardening & Landscaping Stack Exchange) (https://gardening.stackexchange.com/questions/67941/transplanting-this-bluebell-from-the-centre-of-my-lawn) Transplanting this Bluebell from the centre of my lawn (The Workplace Stack Exchange) (https://workplace.stackexchange.com/questions/200804/how-to-handle-teammates-pressuring-me-even-publicly-to-redo-my-work-after-i-al) How to handle teammates pressuring me (even publicly) to redo my work after I already explained my reasoning? (Home Improvement Stack Exchange) (https://diy.stackexchange.com/questions/317381/what-is-this-orange-button-on-my-antique-black-decker-drill) What is this orange button on my antique Black & Decker drill? (Mathematics Stack Exchange) (https://math.stackexchange.com/questions/5060535/do-limits-leave-residual-infinitesimals-or-do-they-resolve-exactly) Do limits leave residual infinitesimals, or do they resolve exactly? (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/266153/how-could-technological-development-be-significantly-accelerated-without-a-major) How could technological development be significantly accelerated without a major war? (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/744910/what-are-induced-atmospheric-variations-and-how-do-they-cause-grid-desynchron) What are 'induced atmospheric variations', and how do they cause grid desynchronization? (Current Spain-wide power outage) (https://stackoverflow.com/feeds/question/41099318) (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/41099318) () (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.25785 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