nginx-config

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 doesn't listen on port 80 twice?

喜欢而已 提交于 2020-06-12 07:14:30
问题 Edit: Read this, first: Apart from the accepted answer, these errors occur when nginx is started without systemd. Kill nginx: ps -ax | grep nginx → find the nginx master pid → kill ### ; run nginx with systemd: systemctl start nginx . If systemctl is not used to start nginx, systemctl stop nginx doesn't seem to work (at least on my server); so, systemctl restart nginx gives this error when it tries to start nginx a second time. About my setup: I'm on Debian 10, Buster, with a live server. I

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

“no-referrer-when-downgrade error” Angular app on Firebase connecting to NGINX Jelastic

 ̄綄美尐妖づ 提交于 2020-03-05 06:07:03
问题 I have the following architecture: An Angular webapp hosted on Google Firebase (HTTPS) A jelastic environment with: An NGINX server (HTTPS) A Springboot 2 application server (HTTP) In order to work fine Firebase needs to use HTTPS API, so I added to the NGINX server an SSL certificate and a public IP. If I call the API using HTTP from postman the calls work fine. But if I call the API HTTPS from the Angular app in firebase than it doesn't work and I get this error: "Referrer Policy: no

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

“no-referrer-when-downgrade error” Angular app on Firebase connecting to NGINX Jelastic

北慕城南 提交于 2020-03-05 06:05:16
问题 I have the following architecture: An Angular webapp hosted on Google Firebase (HTTPS) A jelastic environment with: An NGINX server (HTTPS) A Springboot 2 application server (HTTP) In order to work fine Firebase needs to use HTTPS API, so I added to the NGINX server an SSL certificate and a public IP. If I call the API using HTTP from postman the calls work fine. But if I call the API HTTPS from the Angular app in firebase than it doesn't work and I get this error: "Referrer Policy: no

NGINX: Obfuscate password in access_log

試著忘記壹切 提交于 2020-02-06 06:39:09
问题 The bounty expires in 2 days . Answers to this question are eligible for a +50 reputation bounty. Jon Mitten is looking for a canonical answer : “This is a common requirement for cloud debugging, and the regex pattern would be very valuable.” I want to log the $request_body in the access logs. But some of the requests have some JSON fields that are sensitive like passwords. Example: [2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\x22test@test.com\x22,\x22password\x22:

Why isn't my nginx web server handling ttf fonts?

安稳与你 提交于 2020-01-07 08:46:29
问题 I've been researching this issue where a specific font file isn't rendered on remote sites because of CORS restrictions. So far I have been able to identify that requests for that url are responding with access-control-allow-origin, but nginx is rejecting requests for that font when made remotely. I am using laravel and the laravel-cors plugin from spatie, but I wouldn't think that would return header information for a style sheet or font not rendered from laravel routes. Does anyone know why