21
votes
Can nginx serve SSH and HTTP(S) at the same time on the same port?
Since nginx version 1.15.2 added new variable $ssl_preread_protocol. And in official blog added post about how to use this variable for multiplexing HTTPS and SSH on the same port
https://www.nginx....
20
votes
Accepted
Nginx serves site even if server_name does not match
nginx always has a default server. In the absence of any server block explicitly marked as default_server, nginx will use the first server with a matching listen directive.
You can define a catch-all ...
18
votes
Accepted
Get Nginx to always serve index
The common pattern uses try_files with a default URI. For a minimalist example:
server {
root /path/to/root;
location / {
try_files $uri $uri/ /index.html;
}
}
See this document ...
18
votes
Metallb vs Nginx Ingress in Kubernetes
You will need both, as they solve separate problems:
MetalLB receives requests from the outside of the cluster, and balances them across the load balancer(s) in the cluster
Nginx receives requests ...
17
votes
Accepted
can't run nginx in alpine linux (docker)
The /run/nginx directory does not exist on the latest alpine containers.
You can either create the directory or change the PID file location.
Create the directory in your Dockerfile:
RUN mkdir -p /...
13
votes
Accepted
Nginx without public certificate
Your question (and justification) for the question as asked don't really make much sense technically. I can make some statements which I hope may be helpful to you -
To configure NGinx without a ...
11
votes
Can nginx serve SSH and HTTP(S) at the same time on the same port?
I have a working configuration tunneling ssh over tls on port 443, using the nginx stream module.
I also do XMPP over TLS and normal HTTP on the same port.
I do the mutliplexing via ALPN.
(You need ...
11
votes
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate
It's an SSL cert verification since you're using a self-signed cert this validation will not work.
References:
https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-...
10
votes
Host .p7b HTTPS certificate in nginX
They both contain the same data (mostly), in different formats. Nginx will want the "plain" .crt format, but not all CAs include the necessary data in it, so it's possible that you'll need to convert ...
10
votes
Accepted
How can I setup a UDP NGINX reverse proxy, and how does it work?
Does NGINX need to be on both the proxy server, and the server that the proxy will forward to?
This is typically not necessary.
I am confused regarding the [listen directive.]
The listen ...
10
votes
Nginx without public certificate
... but all the API client (whitelisted clients) should SSL-pinning the public certificate within their Apps, instead of getting the certificate adhoc per request. So we don't need the nginx to ...
9
votes
Accepted
can't access website by ip but I can access by fully qualified domain
There are a variety of reasons this might be the case. Here are just a couple:
host headers - In short, the webserver might host multiple websites on a single IP address. Without the domain name, it ...
9
votes
Accepted
Nginx creates log files owned by root instead of specified user
tl;dr
This might be a bug. When nginx starts it creates log files in ngx_init_cycle() which does not seem to call chown() on the log files. However, when you instruct nginx to reopen the files (nginx -...
8
votes
how to reload nginx - systemctl or nginx -s?
Currently there is a difference on Centos 7 and RHEL 7. Using systemctl reload nginx will NOT validate your configuration.
See the following bug: https://bugzilla.redhat.com/show_bug.cgi?id=1565377
...
7
votes
Permissions for SSL key?
I had an issue getting nginx setup and came across this question. The other answer here has already directly answered the question but I thought a little more information would be helpful.
Normally, ...
7
votes
Nginx Reverse Proxy wants } at end of htpasswd
You placed the htpasswd in the sites-enabled directory of nginx.
In the nginx.conf, there is probably a line like this:
include /etc/nginx/sites-enabled/*;
So all files in that directory are treated ...
7
votes
Accepted
How to use nginx as a reverse proxy on a Ubiquiti router
NOTE: Upgrading to firmware 2.x or above will allow you to use the new Stretch repository as documented in the tutorial linked to in the question. The Stretch repository updates the nginx package to ...
7
votes
Accepted
Running server on home network with HTTPS
Your Nginx can handle the a http and https request.
Set your nginx to listen on port 80 and redirect 80 request to 443.
server {
listen 80 default_server;
listen [::]:80 default_server;
...
7
votes
Accepted
Cannot install Nginx on AWS EC2 AMI2 - Topic :topic: is not found
You need to do the following:
Type amazon-linux-extras to list the packages that are there, and copy the version of nginx, for example nginx1.2
Then type sudo amazon-linux-extras install nginx1.2
6
votes
Accepted
nginx-rtmp pushing from one application to another
you can watch it if you put into vlc exactly this: "rtmp://example.com/source/$name". if you want to use $name as variable, you need to remove it from rtmp push completely, so your setup will look ...
6
votes
Homebrew does not completely uninstall nginx
from terminal,
uninstall nginx using: brew remove nginx
remove nginx config files using: rm -r /usr/local/var/run/nginx
6
votes
Accepted
nginx : HTTP/2 switch to HTTP/1.1 (testing)
Based on Alexey Ten comment above (thank you !), I confirm that nginx requires to have no server(s) running HTTP/2 to get back to HTTP/1.1 (default).
In other words, setting up the directive http2 in ...
6
votes
can't access website by ip but I can access by fully qualified domain
Apache and nginx both (not sure about others....) can serve multiple sites from the same IP based on the host name that is used to connect and request the file(s).
But when you access the server via ...
6
votes
Accepted
How to allow specific SSL client certificates in Nginx?
Nginx has access to the client certificate's fingerprint and serial number in $ssl_client_fingerprint and $ssl_client_serial, and the issuer's DN with $ssl_client_i_dn. See this document for details.
...
5
votes
Nginx as forward proxy for HTTPS
If you don't mind compiling nginx from source, you could install ngx_http_proxy_connect_module. The following worked for me in Debian 9 "Stretch" on a Raspberry Pi (after I added deb-src URLs to /etc/...
5
votes
Can nginx serve SSH and HTTP(S) at the same time on the same port?
Or, you could proxytunnel ssh through your nginx with HTTP/S connection
Take a look: proxytunnel
5
votes
Accepted
Does a cert's filename matter?
The name of the files does not matter at all, only its content. What matters is that the path in the configuration matches the actual path on disk so that the files can be accessed. Of course, if the ...
5
votes
Accepted
docker-composer up error nginx: PermissionError: [Errno 13] Permission denied
When sudo is not an option, adding the user to the docker group does the trick:
To run Docker as a non-root user, you have to add your user to the docker group.
- Create a docker group if there isn't ...
5
votes
Accepted
Nginx reverse proxy to non-HTTP software
Yes, you need to use streams.
In NGINX Plus Release 5 and later, NGINX Plus can proxy and load
balance Transmission Control Protocol) (TCP) traffic. TCP is the
protocol for many popular applications ...
5
votes
Accepted
Overwrite ExecStartPre= in systemd drop-in
As per systemd.service man page on ExecStart= (same syntax):
If the empty string is assigned to this option, the
list of commands to start is reset, prior assignments of this
option will have no ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
nginx × 1037linux × 163
reverse-proxy × 102
ubuntu × 101
php × 89
ssl × 86
networking × 84
webserver × 84
proxy × 76
docker × 67
apache-http-server × 60
https × 41
debian × 35
centos × 33
dns × 29
http × 24
certificate × 22
permissions × 20
letsencrypt × 20
port-forwarding × 19
ssh × 18
ffmpeg × 18
redirection × 18
wordpress × 18
rewrite × 18