can not connect zammad remotely, outside - ip

I have installed zammad on ubuntu 20.4,
I can open zammad with localhost address but can not connect to zammad from remote with server IP address
I have edited the file /etc/nginx/sites-available/zammad.conf
#
# this is the nginx config for zammad
#
upstream zammad-railsserver {
server 127.0.0.1:3000;
}
upstream zammad-websocket {
server 127.0.0.1:6042;
}
server {
listen 80;
listen [::]:80;
# replace 'localhost' with your fqdn if you want to use zammad from remote
#server_name localhost;
server_name 10.20.60.200;
# security - prevent information disclosure about server version
#server_tokens off;
root /opt/zammad/public;
access_log /var/log/nginx/zammad.access.log;
error_log /var/log/nginx/zammad.error.log;
client_max_body_size 50M;
for server_name I have put my IP adress, and with this IP address can not connect to zammad, but with 127.0.0.1:3000 it is connecting
can anyone help on thi, please?

Give in the URL 10.20.60.200:3000. It is enough, when you just only give the IP adress without port into the URL.

Related

Bind SSL certificate to a port number -- Nginx

Sorry for the limited understanding of Nginx and SSL. I have a React and Django app deployed on a server running on Nginx.
The React app is accessible using "example.org"(name is faked for demo purpose) and for the Django app, I have configured it to be accessible with port 3000 ie "example.org:3000".
The domain has SSL certificates installed and certificates are seen in "example.org" but while accessing "example.org:3000", the certificates are not available to this port.
I have been trying to allow ssl certificates to the port as well but couldnt succeed. I changed nginx conf file with listen 3000 ssl without success.
Please help, is there a way or should we need to modify the ssl certificates?
Nginx config at the moment is:
server {
listen 80 default_server;
server_name example.org;
return 301 https://example.org;
}
server {
listen 443 ssl;
server_name example.org;
ssl_certificate /etc/nginx/ssl/ssl_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example.key;
location / {
root /home/ubuntu/example/build;
index index.html index.htm;
}
}
The Port has nothing to do with the certs OR TLS Termination in general. IN case my assumptions are correct and your Django app is exposing its port 3000 by itself you need a proxy configuration that terminates the TLS for you.
server {
listen 8080 ssl;
server_name example.org;
ssl_certificate /etc/nginx/ssl/ssl_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example.key;
location / {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header Host $host;
.....
}
}
This will terminate the TLS Session for you on Port 8080 and forwards the traffic to your Django app. There are other, more advanced options, proxying traffic to your appserver but this one will do it.
Note: In case you want to proxy the traffic through NGINX make sure Port 3000 is not exposed to the public anymore.

Nginx win server 2012 - Configure proxy pass

I have a node server listening on localhost:8080 and I'd like to use nginx as proxy pass, so i made nginx listen to port 80 incoming connections. However I'm not able to configure nginx config to do the reverse proxying. I do not currently have a domain, only server IP. So I'm guessing server_name has to be set to $host or something?
events{
}
http{
server{
listen 80;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host 127.0.0.1;
}
}
}
If I try to visit my server IP on port 80 I just receive welcome to Nginx page.
You should reload and restart your nginx
sudo service nginx reload
sudo service nginx restart

Port redirection for domain

I have NGINX on my VPS working on port 80 (few domains on it), and I want add GlassFish on port 8080.
Next I want add domain for GlassFish, but on domain it should work on port 80.
How I can do that?
Him add server rule, for example:
server {
listen 80;
server_name demo.glass.fish;
location / {
proxy_pass http://localhost:8080;
}
}

How to configure nginx so that the web server only allow access via IP address and deny all access via domain name?

Suppose I have a web server running on the IP address 1.2.3.4 and the domain name abc.com resolves to 1.2.3.4. How shall I write the nginx.conf so that the web server only allows access via the IP address 1.2.3.4 and denies all access via the domain name abc.com?
nginx.conf:
http {
...
server {
listen 80;
server_name 1.2.3.4;
}
...
}
Currently I set server_name to 1.2.3.4, and it seems that the web server is accessible via both 1.2.3.4 and abc.com.
I would define two server stanzas. One for abc.com to which access is denied. Then define a catch-all server that can be accessed via ip address:
server {
listen 80;
server_name abc.com;
return 403;
}
server {
listen 80 default_server;
server_name _;
}

To test Nginx load-balancing in local system

I wanted to test if nginx is redirecting to node-2 if node-1 is down.
For that, I installed tomcat in my local windows machine and started 2 instances in 8080 and 9090 port
Dont know how to configure nginx for this. I tested by adding below blocks in nginx.conf . But still it is not working for me. Please help me on this
proxy_redirect ~.*:909[0-9]/(.*)$ /$1;
proxy_redirect ~.*:808[0-9]/(.*)$ /$1;
upstream localhost {
server localhost:8080;
server localhost:9090;
}
server {
listen 8080;
server_name localhost;
}
Replace the server block by below block
server {
listen 8080;
location / {
proxy_pass http://localhost;
}
}

Resources