nginx-location

Running multiple django project on same ubuntu instance using nginx as a proxy server, nginx is forwarding some requests from one domain to wrong port

梦想的初衷 提交于 2020-08-10 03:37:20
问题 I want to run three subdomains on the same server and the same service in a different folder all this are Django service. bellow is the Nginx conf file I am trying to run request-micro service on the same server with a different domains and different folders. I am already running two test server domain on 2732 port in "home/user/test/" folder and its running fine, Now I am trying to run dev server on 2742 port in different directory "/home/user/dev/" but some times the test server requests

Nginx multiple locations with different roots

こ雲淡風輕ζ 提交于 2020-06-25 22:10:30
问题 I have really simple nginx configuration with 3 locations inside. Each of them have it's own root directory + I should be able to add another in the future easily. What I want: Request /admin => location ^/admin(/|$) Request /admin/ => location ^/admin(/|$) Request /admin/blabla => location ^/admin(/|$) Request /client => location ^/client(/|$) Request /client/ => location ^/client(/|$) Request /client/blabla => location ^/client(/|$) Request /blabla => location / Request /admin-blabla =>

Server block not routing correctly #nginxhelp

戏子无情 提交于 2020-06-16 19:04:33
问题 I have setup an NGINX server with multiple server blocks. I have configured 2 simple websites to run on the same server. They point to two different root paths specified in the respective server block file. I have updated the DNS details for both the domains: Name Servers: updated details as per registrar A records: updated same static IP address However, when I test with domain2.com in the browser, it redirects to domain1.com. What am I doing wrong? I have already restarted the nginx server

Nginx: serve multiple React applications on the same server

左心房为你撑大大i 提交于 2020-05-29 10:57:25
问题 I am trying to set up multiple React apps on the same server. The problem is that after I build the project, index.html from build/ is found, but the auxiliary files from build/static are not. Initially, with just one app, I had location static/ with an alias. However, with multiple projects and multiple static/ directories I can not do that. Basically I want that each app to has its own static folder. How do I solve my problem? In the browser, the error looks like this: GET http://my

Nginx: serve multiple React applications on the same server

谁都会走 提交于 2020-05-29 10:56:06
问题 I am trying to set up multiple React apps on the same server. The problem is that after I build the project, index.html from build/ is found, but the auxiliary files from build/static are not. Initially, with just one app, I had location static/ with an alias. However, with multiple projects and multiple static/ directories I can not do that. Basically I want that each app to has its own static folder. How do I solve my problem? In the browser, the error looks like this: GET http://my

Compose URL address on the location with the server IP address using upstream on Nginx configuration

巧了我就是萌 提交于 2020-04-18 00:50:08
问题 I have this situation where a have lots of API´s running on different machines on different ports using Tomcat. I can create the upstream with those IP addresses but how to add the other part of the URL to the upstream when setting the proxy_pass? The upstream: upstream login_api_stream { least_conn; server 10.2.54.8:8185; server 10.2.54.8:8285; server 10.2.54.8:8385; server 10.2.54.9:8085 backup; } Then I create the location inside http: location /login-api/ { add_header X-Real-IP $remote

Removing .html from a link using NGINX

走远了吗. 提交于 2020-03-25 08:42:30
问题 I've this configuration for my nginx site-available file. It creates a link like https://website.com/news-id.html What i want to do is to remove "news-" and .html from the link and make the url clean with just https://website.com/id I have tried several methods but everytime i run into a redirection loop. **I tried several times to put the code here but failed. So here is the link to the config file https://jpst.it/1AKIf 回答1: Try this config. server { location / { # Redirects to the version

Removing .html from a link using NGINX

两盒软妹~` 提交于 2020-03-25 08:42:07
问题 I've this configuration for my nginx site-available file. It creates a link like https://website.com/news-id.html What i want to do is to remove "news-" and .html from the link and make the url clean with just https://website.com/id I have tried several methods but everytime i run into a redirection loop. **I tried several times to put the code here but failed. So here is the link to the config file https://jpst.it/1AKIf 回答1: Try this config. server { location / { # Redirects to the version

nginx 2 locations for different apps (react and angular)

有些话、适合烂在心里 提交于 2020-03-05 06:06:21
问题 I have a React application and an admin dashboard which is built in Angular: /var/www/example.com/example/web <- React /var/www/example.com/example/admin <- Angular This is my Nginx config: server { server_name example.com; index index.html index.htm; # React location / { root /var/www/example.com/example/web/build; try_files $uri $uri/ /index.html; } # Admin location /admin { root /var/www/example.com/example/admin/dist; try_files $uri $uri/ /index.html; } } When I navigate to example.com

nginx 2 locations for different apps (react and angular)

我们两清 提交于 2020-03-05 06:05:45
问题 I have a React application and an admin dashboard which is built in Angular: /var/www/example.com/example/web <- React /var/www/example.com/example/admin <- Angular This is my Nginx config: server { server_name example.com; index index.html index.htm; # React location / { root /var/www/example.com/example/web/build; try_files $uri $uri/ /index.html; } # Admin location /admin { root /var/www/example.com/example/admin/dist; try_files $uri $uri/ /index.html; } } When I navigate to example.com