New answers tagged nginx
0
votes
Use hostname for set_real_ip_from in Nginx
Since 1.13.1, trusted addresses may also be specified using a hostname.
0
votes
Accepted
Nginx add_header only works when content type specified
Eventually, I managed to piece this together.
set $special_headers false;
set $special_link '';
location ~* "/Record\.([A-Za-z0-9]{4,6})$" {
set $special_headers true;
set $special_link ...
0
votes
Use hostname for set_real_ip_from in Nginx
As per Nginx's documentation, no. You can use an IP, CIDR, or unix socket :
Syntax: set_real_ip_from address | CIDR | unix:;
0
votes
Nginx conf duplicate issues
Let's Encrypt will manage these properties directly. Certbot will add the following line to your nginx.conf file:
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
For Certbot to ...
0
votes
Nginx try_files succeeds on deleted files, then nginx reports error with open()
This is just a wild guess, but when file is deleted on Linux opened handle remains valid. Is it possible, that NGINX process still sees the old, deleted file as valid but no other process may open it?
...
1
vote
Nginx as forward proxy for secure LDAP
For nginx you must configure a stream block which terminates the SSL/TLS connection from the client -- using a cert trusted by the client for the hostname the client uses, see below -- and originates ...
2
votes
nginx in front of Rails
Why do you think that the configuration of your origin server has anything to do with the protocols of the reverse proxy in front of it?
Just configure mypage.com and secure.mypage.com as different ...
1
vote
Accepted
How does NGINX Plus handle server failure when doing session persistence for TCP/UDP communication?
It feels like the two might become mutually exclusive
Yes. That's not a problem specific to nginx. By far the best solution is to have your session data replicated / highly available - but that's not ...
-1
votes
nginx, serve php files
It appears to be a browser issue particularly Chrome. Chrome doesn't like serving documents over HTTP it's cries HTTPS only and downloads rather than serving docs. Even following a browser cache ...
0
votes
Filtering the $query_string in Nginx
Good afternoon, everyone. In any case, you will need filtering not only fields, but also filtering forms, URL links, etc. I have not been looking for a similar solution for a long time, but for other ...
0
votes
uwsgi queue of socket message flood?
recomiendo aumentar el net.core.somaxconn a 200 con:
sysctl -w net.core.somaxconn=200
o hacerlo permanente desde su /etc/sysctl.conf file conf
1
vote
Serve multiple apps with nginx proxy_pass
I think I figured out what you are trying to solve.
When you request a page from /app2/ it tries to load additional resources like /main.js, which results in a 404 error because it should be /app2/...
1
vote
Accepted
Target app assets not loaded with nginx proxy_pass
After further digging and testing, the rewrite solution detailed in https://stackoverflow.com/questions/62836801/nginx-reverse-proxy-how-to-serve-multiple-apps worked in my case.
This is the snippet I ...
0
votes
I am getting 413 requested entity is too large error while uploading audio files to flask website
Try to add this line at your site conf.
server {
...
client_max_body_size 0;
...
}
You can change the value to 200M, for example.
After that, restart your nginx.
2
votes
Accepted
Extract XML Request body variable into an nginx variable
In the map method, I will replace $s by $1 so it will assigned the extracted value to the student_id. Therefore you can use the student_id variable in your if statement. That's how I was able to ...
0
votes
nginx and php-fpm waiting for server too long
Yes, there's stuff wrong with your config, but your primary issue is arising within the PHP execution (or any persistence layer such as a DB underneath the PHP).
Check for session contention, ...
0
votes
nginx and php-fpm waiting for server too long
You should install xhprof, this way you'll see where the time is spent.
Using PECL (https://pecl.php.net/package/xhprof)
pecl install xhprof
And use the xhprof_html and xhprof_lib from this project ...
0
votes
nginx systemd[1]: nginx.service: Failed with result 'exit-code'
Maybe you can remove nginx first and reinstall it.
List packages installed related to nginx, and remove them.
dpkg --get-selections | grep nginx
sudo apt --purge remove nginx
sudo apt --purge remove ...
0
votes
Nginx upstream reponse time occasionally very slow
So after turning on debug output in Nginx it seems the problem was with the Nchan module in the nginx-extras package from Phusion Passenger, that one is buggy and would hang once in a while, once i ...
0
votes
How redirect ANY site not found in Hestia to another server - Nginx proxy manager
This should be a comment, but it's a bit long.
I don't know what you are asking here.
If you are terminating the SSL on the nginx server, then either you have an absolute monster of an SSL certificate,...
0
votes
nginx autoindex: include dot (hidden) files in directory listing
it is now possible to use fancyindex module to show dot/hidden files
0
votes
How to switch PHP versions in Nginx if fastcgi_pass is pointing to a TCP socket
Perhaps my question wasn't clear, I'm not a sysadmin, so it's not all as clear to me as it probably should. However, reading @symcbean's answer made it clear to me that switching to a UNIX socket ...
0
votes
How to switch PHP versions in Nginx if fastcgi_pass is pointing to a TCP socket
Your question is a bit confused - there are at least 3 configurations (8.2 with network socket, 8.1 with network socket, 8.1 with network socket) only the nginx conf for one of the configurations and ...
-1
votes
Serve multiple apps with nginx proxy_pass
What I do is Create a "sites-enabled" and "sites-available" Folder, inside of the "/etc/nginx" Folder.
Then, I Add the following Line to my nginx.conf file.
Include /etc/...
0
votes
Multiple subdomains to log into phpMyAdmin with Nginx
That's not HTTP redirection, but the Nginx can serve the same web application from multiple host names or paths. The server_name has
Syntax: server_name name ...;
in your case:
server_name pma....
0
votes
How do I remove a server-added header from proxied location?
I had the exact same issue.
We have global CSP rules at the nginx.conf (http) level which then needed to be removed at the server level / virtualhost level to let the proxied CSP header - generated by ...
0
votes
Accepted
502 Bad Gateway nginx 1.20.1
From the commands you provided above, you did not install php-fpm. You need to run
yum install --enablerepo=remi-php80 php-fpm
0
votes
Accepted
NGINX: Redirect to Non-www address
(this is mostly comment, but space is limited)
I want all http traffic to redirect to https,
OK, seems sensible.
and connections to my website's www subdomain and to my server ip address (123.123....
0
votes
Accepted
What steps can I take to troubleshoot why my server is not accessible over HTTPS after enabling SSL with Certbot?
Since you just basically posted only minor information, based on that, the Configuration might work:
# Default server configuration
# which means its a catch all for these that are not configured, if ...
0
votes
How can I configure Nginx to redirect all traffic to my website to the HTTPS WWW version and HTTPS version for subs with a consistent URL structure
The problem was actually from cloudflare.
I managed to fix by clearing cloudflare cache.
also the client_max_body_size 8M; was to small changed it to 16M.
0
votes
Accepted
How to serve php files from a folder outside of web root folder in nginx
Your values for root and SCRIPT_FILENAME under the location ^~ /php block are incorrect.
The URI currently being processed includes the prefix /php/ and is combined with the root value to form the ...
1
vote
Preview website without DNS like hostcx
Creating a website like HostCX using Nginx Reverse Proxy is certainly possible. Nginx can be a powerful tool for routing incoming requests to different backend servers based on various criteria, ...
0
votes
Nginx having multiple sites-enabled breaks nginx
@symcbean actually pointed out the answer. The configs I posted were incomplete. For app1 I used the exact config shown (which worked somehow) and then ran certbot which added the TLS config and ...
1
vote
Nginx. Override header in cached object, is it possible?
Seems like you're looking for proxy_hide_header directive.
0
votes
nginx download the latest file based on filename pattern
That's not possible with vanilla nginx since it cannot do math within it's basic config syntax.
However, it's possible with Lua code in it's config, - you can implement any logic you want; minimal ...
0
votes
Nginx check if parameters exists and if so only allow specific values
I guess that you need something like this (using map):
map $arg_page $need_redirect {
default "1";
"" "0";
"2" "0";
"14" ...
0
votes
GitLab Pages running in Docker inaccessible from outside the container
My latest config for gitlab 16.x.x
GITLAB_OMNIBUS_CONFIG: |
### Web interace settings
external_url "https://gitlab.domain.org"
nginx['listen_port'] = 80
nginx[...
0
votes
Trying to run Security Onion on AWS behind an ALB (nginx behind ALB)
I was able to get this working by inserting a simple healthcheck in the nginx config.
server {
listen 443 ssl http2;
server_name 192.168.1.something;
location ...
1
vote
nginx proxy_pass using subfolder
The answer of Tero Kilkanen is great. However, in some situations, the non-named regex group(ex: $1) cannot be found. We can use the named group(ex: $sub_dir) to prevent this error.
location ~/app2(?&...
0
votes
nginx: [warn] protocol options redefined
I experienced the same issue because the default_server block did not include the ssl directive.
So it should have been:
server {
listen 443 default_server ssl;
listen [::]:443 default_server ssl;
...
0
votes
Get file exif data in NGINX
File modification time is NOT the same as the photo creation date.
While it would be simple to force the mtime to match the EXIF data and use that as a proxy for the data you actually want to report, ...
0
votes
Showing images using a template .html file in NGINX
here is my full config. I've changed it a bit since and it works now:
map $request_uri $request_basename {
~/(?<captured_request_basename>[^/?]*)(?:\?|$) $captured_request_basename;
}
server {...
0
votes
Accepted
Unable to verify TLS cert with only CommonName in NGINX reverse proxy
I ended up getting this mostly working.
I traced the NGINX error to X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE. Turns out, the certificate wasn't actually self signed. It was signed by a private CA, ...
0
votes
Running PHP7.4 FPM on Ubuntu. Forgot to install PHP7.2-curl. Wondering if I will need to bring down all the other websites for the change
When restarting php-fpm, it is all or nothing. Unfortunately there is no way to restart an individual site pool.
Top 50 recent answers are included
Related Tags
nginx × 17060reverse-proxy × 1621
php-fpm × 1326
ssl × 1207
php × 1032
ubuntu × 1016
rewrite × 922
linux × 841
apache-2.2 × 720
redirect × 622
proxy × 611
docker × 562
wordpress × 560
web-server × 550
https × 533
configuration × 479
cache × 451
http × 409
load-balancing × 387
django × 369
centos × 357
fastcgi × 347
proxypass × 327
node.js × 308
ssl-certificate × 306