Questions tagged [nginx]

nginx (pronounced “engine-x”) is a lightweight, high-performance Web server/reverse proxy and e-mail (IMAP/POP3) proxy, licensed under a BSD-like license.

Filter by
Sorted by
Tagged with
2 votes
0 answers
19 views

Nginx unclear about non HTTP requests

Today my website server had to be restarted. It seems it faced an important number of requests that do not look like HTTP ones. While the density of requests reduced, I can still see some of them ...
user avatar
  • 121
-1 votes
1 answer
34 views

Missing SSL certificate cause unwanted redirect to another website

I have a website without SSL certificate. When opened in browser it shows error message: "Potential Security Risk Ahead" which is good but when click "accept the risk and continue" ...
user avatar
0 votes
0 answers
22 views

Redirect wildcard domain to another one in nginx

I have two websites *.env1.example and *.env2.example, I want to redirect all traffics in env1 to env2, how to do so in Nginx? I do redirect from one specific domain to another, but now I want to ...
user avatar
0 votes
0 answers
17 views

Running If Statement in NGINX website configuration files

Im trying to use an if statement that allows me to ignore headers only when caching a request. This is the code I implemented ( on /etc/nginx/sites-available/example.com) : if ($skip_cache = 0) { ...
user avatar
0 votes
0 answers
32 views

What is reddit's user agent?

Does anyone know what the user agent is for reddit? I have hotlink protection enabled on my site but I want to allow a reddit to hotlink my image however I don't know know what their user agent is.
user avatar
2 votes
1 answer
24 views

Nginx access log clarification

I noticed the below line of log in the nginx access log file. What does it mean? 15.23.35.45 - - [19/Feb/2022:07:09:25 +0000] "" 400 0 "-" "-"
user avatar
2 votes
1 answer
50 views

Why Doesn't "location /" Match Every URI in Nginx

In Nginx, according to this question's answer https://stackoverflow.com/questions/59846238/guide-on-how-to-use-regex-in-nginx-location-block-section when using no modifier between the location ...
user avatar
5 votes
1 answer
800 views

Is it safe to use 777 for my public html folder?

Running a Linode and I want to install Nextcloud, but it needs permissions to write to the directory (/var/www/html). Doing a chmod 777 will clear things up but I wonder if it's safe to use that open ...
user avatar
1 vote
0 answers
16 views

How to redirect if user direct access image files by browser? [nginx]

How do I redirect if a user tries to direct access image files in browser only? I want to still keep the ability to allow social media sites to embed our images by hotlinking. I just want only if a ...
user avatar
1 vote
1 answer
43 views

How to cache the html file of redirected website

I have a website A whose content gets updated every minute(Its content is related to stock price). However, because displaying the content of website A requires expensive computation, I want to create ...
user avatar
1 vote
1 answer
27 views

The role of server_name in DNS resolution and redirects in nginx

I understand there's a name resolution. For instance, I have a DNS A record I think and it redirects everything that goes to bi.example.com to www.example.com, which is the hostname of the server. But ...
user avatar
  • 13
1 vote
0 answers
15 views

Nginx works on http but not on https, showing welcome to centos page

I am trying to server flask application with ssl enabled. myproject.service file: [Unit] Description=Gunicorn instance to serve myproject After=network.target [Service] User=userone Group=userone ...
user avatar
  • 11
1 vote
1 answer
44 views

How do I redirect from an old domain to a new domain in MediaWiki and nginx?

I'm going to move from old domain to new domain. I fixed all the settings, but none worked. While entering the old domain name in the url, I will encounter the message of not redirecting to the new ...
user avatar
1 vote
1 answer
281 views

nginx how to configure nginx to nevigate to a subpage for reactjs app

I have following nginx setup where I used proxy configuration to redirect my landing page (built with reactjs) to my domain, say (www.example.com), here is my nginx configuration server { listen 80; ...
user avatar
2 votes
2 answers
91 views

Cloudflare plus Nginx plus Tomcat - is Nginx redundant?

With my past project, I have Nginx serving static files as well as being a reverse proxy for Tomcat (backend written in Java). There was no Cloudflare or other CDN. With my current project, I have ...
user avatar
  • 195
5 votes
1 answer
193 views

Nginx reverse proxy into external cPanel server results in an error

I am trying to reverse proxy into a cPanel account by attempting to use the following Nginx configuration (123.123.123.123 is the cPanel IP), but I'm getting an error: ERR_TOO_MANY_REDIRECTS server { ...
user avatar
1 vote
1 answer
112 views

How do i setup a simple smart dns proxy service using nginx? [closed]

I have trying to setup a smart dns proxy service using nginx reverse proxy mode. its ok with http sites but i have issues with https sites. when i want to open https sites via my proxy i got following ...
user avatar
1 vote
2 answers
140 views

Redirect all requests to a subdomain except the root URL and index page under nginx

Up until now, our website consisted of a wiki with several wiki sites. We now decided to host some general information on a single page and move the wiki to a subdomain (https://wiki.example.com/). I ...
user avatar
  • 121
3 votes
1 answer
94 views

ServerAlias directive not working on Apache 2.4.49

I have an instance of WordPress set up at https://wordpressinstance.example. I have an instance of MediaWiki set up at https://mediawiki.wordpressinstance.example. The MediaWiki instance is ...
user avatar
3 votes
2 answers
218 views

Is it possible for a hacker to point another domain at my domain?

Recently when I search my website on google, I find that another domain's description is identical to my domain. I'm terrified and try to understand the security breaches of my website as much as ...
user avatar
2 votes
1 answer
64 views

nginx configure error pages

Mostly that I need to be more familiar with the configuration of nginx and I have tried to search for an answer but have been unable to find one,I need to have all 401 403 and 404 errors directed to /...
user avatar
  • 265
1 vote
1 answer
109 views

Configure nginx to set the content type from the URL only when there is an allowed user

I implemented a location configuration like this (legituser is set by a map lookup): location / { if ($legituser = 0) { return 200 "you are not allowed to access this url, please do bla bla ...
user avatar
  • 133
0 votes
1 answer
33 views

Can I tell who is accessing archive.org archived documents from my site from my server logs?

I currently host a website with a collection of some of my projects, where a few of them are currently undergoing a patent review process. I don't want these documents to be public (though they were ...
user avatar
0 votes
0 answers
21 views

In nginx How can I replace invalid image with a valid image?

I have faced a problem. In my app there is lot's of article. So, this is not possible to remove the broken images from article body. So, I am thinking to remove that from server end. My server is ...
user avatar
1 vote
1 answer
104 views

nginx doesn't convert header to http_ variable

According to http://nginx.org/en/docs/http/ngx_http_core_module.html#http nginx takes http headers, does some conversions (set a prefix, replace dash with underscore) and provides them as variables: ...
user avatar
  • 133
2 votes
1 answer
182 views

Block access to multiple files with .htaccess - RewriteRule and FilesMatch fail

I am trying to block access to specific files. Neither the RewriteRule or FilesMatch rules I have tried work on the live server, it serves the files as normal with status 200 OK (I'm expecting 404 ...
user avatar
0 votes
0 answers
25 views

get nginx proxy for https://hostname to work

I'm using nginx to proxy a site internal to our firewall. Right now the following urls work:     http://sitename (-> https://sitename.example.com)     http://sitename.example.com (-> https://...
user avatar
3 votes
0 answers
86 views

Configure Nginx to serve the home page and a sub-directory with WordPress and everything else with Laravel

I'm currently facing a problem where a single vhost must serve two apps. One of them is WordPress, the other one is Laravel. I've managed to get it some kind of working using a URL prefix, but I can't ...
user avatar
1 vote
0 answers
1k views

How do I troubleshoot 403 access forbidden by rule error?

In the first 40-50 minutes after I restart my server (Apache with Ngintron) I get a 403 nginx error, and in the logs it says "access forbidden by rule". I have all my traffic redirected to ...
user avatar
1 vote
0 answers
60 views

Using sub_filter command in Nginx by specifying its starting values

Seems like an odd request but I'm wondering if it's possible to alter values in nginx just by specifying several of its values. I've proxied my business website through nginx so I can have different ...
user avatar
1 vote
0 answers
33 views

How to display only subdomain and not IP address in address bar [closed]

I have a nodejs application running on EC2 instance. The nodejs application is running on port 7000, and I'm using nginx to listen to port 80 and forward any request to that port (so if someone type: ...
user avatar
  • 11
1 vote
1 answer
54 views

Worth moving WordPress to Apache hosting to fix trailing slash duplicate content on Pantheon under Nginx?

Context: As you might know, Wordpress' permalink structure enforces a trailing slash at the end of URLs (so /about becomes /about/ etc.) I've always found this useful -- keeps URLs nice and uniform. ...
user avatar
  • 165
3 votes
0 answers
179 views

Cross origin resource policy violation for JS file when setting COEP, COOP and CORP headers

What is the best way to deal with the new security headers? Cross-Origin-Embedder-Policy (COEP) https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy Cross-Origin-...
user avatar
  • 141
2 votes
1 answer
258 views

nginx https ip address to domain redirect

My website is pretty messed up: it shows up as an IP address in the google search results (https). I want to redirect this to my domain, but when I couldn't figure out how to redirect https to my ...
user avatar
1 vote
1 answer
156 views

Nginx ERR_TOO_MANY_REDIRECTS by adjusting WordPress Permalinks | 301 Error Ubuntu 18.04

OS: Ubuntu 18.04.5 LTS (having my own VPS) WebServer: Nginx/1.18.0 MySQL: mysql Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL) WordPress: 5.6 When I change the Permalinks option in ...
user avatar
0 votes
1 answer
22 views

Moving https website from server A (CentOS 7) to server B (CentOS 8) - what do I need to do regarding certificates?

I've copied all of the referenced files in my nginx configuration over: /etc/nginx/ssl/STAR_example_com/ssl-bundle.crt /etc/nginx/ssl/STAR_example_com/STAR_example.key /etc/ssl/certs/dhparam.pem I ...
user avatar
2 votes
0 answers
43 views

Deny access to all the content of a section of website with Nginx from Plesk

I need to deny access to a part of website and allow some IP Addresses to access it for example my site is example.com it is accessible by every one but example.com/test and all its files are ...
user avatar
1 vote
1 answer
267 views

Generating Nginx log file entries for logrotate testing

How can I generate Nginx log file data for one or more test (burner) domains on a test server? I want to essentially mimic a live website with regular traffic being logged but without the provision of ...
user avatar
4 votes
4 answers
893 views

How to stop domains from pointing to my server IP address and duplicating my site using nginx

I recently created an Ubuntu server and installed LEMP stack after which I hosted my website on the server using WordPress. But after sometime, I notices some domains ranking in Google and loading my ...
user avatar
0 votes
0 answers
35 views

Set up SSL on NGINX

I'm having difficult setting up SSL on nginx running on Ubuntu. I have a .pfx, .crt, and .pem cert files to work with, but the documentation is for setting it up with .crt and .key files. The code ...
user avatar
  • 101
1 vote
1 answer
37 views

convert htaccess to nginx [closed]

I want to convert this htaccess code to nginx. <ifModule mod_rewrite.c> RewriteEngine On ## Application Handler RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-...
user avatar
  • 11
1 vote
0 answers
65 views

nginx location proxy pass forwarding to root URL rather than subdirectory

I am using Nginx as a proxy, example.com is my outward-facing web server with SSL enabled I want traffic coming under https://example.com/gibberish/ to be forwarded under http://localhost:8080/...
user avatar
  • 11
1 vote
1 answer
146 views

Redirect AMP pages to non amp only for users using NGINX

We have a huge news website, with more than 10.000.000 views for month. We have amp pages, and now every indexed content in the google mobile serp is AMP. Basically only direct views go to the mobile ...
user avatar
1 vote
1 answer
55 views

www.subdomain.example.com not working despite trying various DNS entries and Godaddy forwarding options, can only get an nginx error

I have a website that is online at the moment. For this website, I have a subdomain staging.example.com. I am using GoDaddy for domain hosting. My server is on an EC2 Linux instance with AWS. I have ...
user avatar
1 vote
0 answers
10 views

Nginx Rule -Images Not Working [closed]

My .htaccess rules; RewriteRule ^img/([A-Za-z0-9]+)/([A-Za-z0-9]+)/(.*) /img.php?width=$1&height=$2&src=$3&crop-to-fit [NC] My Nginx Rules; rewrite ^/img/([A-Za-z0-9]+)/([A-Za-z0-9]+)/(...
user avatar
3 votes
0 answers
48 views

NGINX configuration for the same folder protection rewrites in each of thousands of subdirectories

The following code allows me to protect a specific folder with the membership software we're using. The problem is if we have 1,000 folders we need to protect, we need to copy/paste this same code for ...
user avatar
2 votes
1 answer
136 views

Detectify false positive (CVE-2013-1966 on uwsgi/nginx)?

Detectify has laready twice informed me of a vulnerability on my website. It is about CVE-2013-1966 (Apache Struts). However I am not even using Apache, my server runs Django on nginx. Can I safely ...
user avatar
  • 227
1 vote
1 answer
67 views

Where To Configure SSL On Nginx Reverse Proxy or on Apache2 on Ubuntu 18.04 Server?

My question is about SSL/TLS. I'm running Ubuntu 18.04 server with: Apache2 serving 3 public domains on 1 public IP. On the same server I'm running: Nginx and will configure as a reverse ...
user avatar
1 vote
0 answers
63 views

How best to perform 4 million 301 jpeg URL redirects to content based addressing on nginx?

I certainly don't want to list 4 million redirects in my nginx config files... what's the best practice with a large number of redirects like this? They'd be permanent as well as the old links live ...
user avatar
1 vote
0 answers
206 views

Why is nginx trying to bind to an IP address that I'm not telling it to, and how can I stop it?

I'm trying to host two separate websites from my VPS. I have two services running on different ports. What I am trying to accomplish is have nginx reverse proxy to Service A if the user types in a ...
user avatar
  • 111

1
2 3 4 5 6