Questions tagged [nginx-config]

2020 questions
0
votes
1 answer

nginx - Redirect to urls without extension and add slash at the end

Using nginx, I would like to redirect all my static html URLs( mydomain.com/index.html; mydomain.com/contact.html; mydomain.com/about.html ) to the same urls without extension but with a slash at the end. The end urls should be like…
Bizboss
  • 7,792
  • 27
  • 109
  • 174
0
votes
0 answers

Nginx React App - Allowing only one location to be accessible

I have a server on DigitalOcean that hosts my web app. The server hosts the API (using Flask) and my web app (React). I managed to set up the Nginx to serve the app and the API using 2 different domains. Now I'm facing a problem. I'm, trying to add…
0
votes
1 answer

Nginx regex pcre_compile() failed

Can someone explain why the following condition is failing? Seems like the last ) is cut off. location / { if ($request_uri !~ "(abc|def)" { return 404; } ... fails with: 2021/10/07 13:29:50 [emerg] 183#183:…
klodoma
  • 4,181
  • 1
  • 31
  • 42
0
votes
1 answer

SOLVED - Nginx can not redirect request from https://www to https://myDomain

OMG! I just solved problem just change this return 301 https://example.dev$request.uri; to this value return 301 https://example.dev$request_uri; More specifically request.uri was invalid !!! My aim is to redirect all requests to the…
monstereo
  • 830
  • 11
  • 31
0
votes
0 answers

Nginx works with ip but returns 404 with domain name

I want to access a website served by Nginx with a domain name. The domain points already to the IP and I can access the site using the IP + Port in the browser. But when entering the domain Nginx returns a 404 Not Found. Here is my config: server…
simplesystems
  • 839
  • 2
  • 14
  • 28
0
votes
1 answer

How to mask sub-domain using nginx

I have nodejs application working with a main domain, and its connecting thought nginx proxy pass to nodejs application, with redirection rule , as per the redirection rule if request is coming from mobile, it will redirect into a sub-domain, it is…
shufilkhan
  • 521
  • 2
  • 6
  • 22
0
votes
1 answer

NGINX 1.11.10 edit cookie SameSite attribute

I have an NGINX 1.11.10 and trying to manipulate the SameSite attribute of cookies. Looks like NGINX has an option proxy_cookie_flags However, this is only available in NGINX 1.19.3 and above. How can I implement similar behaviour in 1.11.10 to…
hoz
  • 502
  • 2
  • 9
  • 25
0
votes
1 answer

How to remove slash from $http_referer variable

I want to use NGINX as dynamic local CDN with proxy_pass based on Referer header and $http_refere variable. The problem is that the Referer (variable too) header contains a "/" at the end of the URL. I want to delete trailing slash in $http_referer.…
0
votes
0 answers

How do I properly add try_url or rewrite for a .html add?

So, coming from the Apache world I am new to configuring NGNIX more than just the root site. I have tried to use an Apache to NGNIX rewrite, but the output doesn't seem to render the pages correctly. Original .htaccess code: RewriteRule ^…
0
votes
1 answer

NGINX target specific upload files on different folders

I need to add a noindex tag to multiple specific uploaded files, but they all belong to different year and month upload folders like this for…
Suika
  • 660
  • 2
  • 10
  • 30
0
votes
0 answers

Nginx "/etc/nginx/sites-available/default file" creating a 404 error

I am creating a project with AWS and some of its services as part of a course activity, and I managed to get the Nginx to run on port 80 as I set it up in my EC2 instance once I disabled Apache from the same port. However, the activity isn't very…
0
votes
1 answer

Nginx picking up wrong directory from configuration

I have written the nginx config file but somehow nginx is looking for the directory /pipelines/videos/neuralAI.mp4 which doesn't exists instead of looking for the /pipelines/assets/neuralAI.mp4 . Any help would be appreciated. location /videos/ { …
0
votes
2 answers

Nginx Match Image Filename Based On Part of URL?

For local development, I'm trying to serve static content out of a public directory. My images live in app/public/images, and my root is app/public. My images are looked up at /d/my_app_name/images/.png. I'm matching the /d/my_app_name/images…
michjo
  • 407
  • 2
  • 17
0
votes
1 answer

How to configure nginx proxy inside a docker-compose?

I want to configure client_max_body_size of a dockerized nginx proxy directly inside the docker-compose.yml. I find this ressources : https://github.com/nginx-proxy/nginx-proxy/issues/690,but it seems none of the solution are adapted. Here is my…
bloub
  • 510
  • 1
  • 4
  • 21
0
votes
1 answer

Nginx serving angular static files

I am configuring to change the deployment of the angular project deployed in nginx. The default files are hosting at /usr/share/nginx/html which works when i access from localhost. However, i will like to define the /dev or /prod at the URL which…
rosepalette
  • 186
  • 2
  • 19