Caddy web server - alias - webserver

There is a Caddy web server in local network listening address https://chat.
A-record (chat - 192.168.10.10) was created in local DNS-server for that local host.
How to configure Caddy for listening https://192.168.10.10:443 as alias?
Current conf file:
https://chat {
bind {$ADDRESS}
tls /var/snap/rocketchat-server/ssl/chat.crt /var/snap/rocketchat-server/ssl/chat.key
proxy / localhost:3000 {
websocket
transparent
}
}

192.168.10.10:443{
redir https://chat{uri}
}

Related

access to vault since other server

I have install a vault in my first server but a when access to my vault since other server
I create a config file config.hcl and i my file i put this
listener "tcp" {
address = "127.0.0.1:8200"
}
listener "tcp" {
address = "myIP:8200"
}
# Advertise the non-loopback interface
api_addr = "https://myIP:8200"
cluster_addr = "https://myIp:8201"
like hashicorp doc
but when i start the server like this vault server -config=./config.hcl
i have this error
Error initializing listener of type tcp: listen tcp4 myIp:8200: bind: address already in use

Serving Static site with Caddy gives connection refused

I have caddy installed and running in my CentOS server,mainly I have it to proxy request to 2 Golang applications that I have running and it's working great! Now, I need to serve a static site, but i't returning connection refused
The structure of my directory is:
|--Caddyfile
|--mygolang1
|--mygolang2
|--FolderofMyStaticSite
|-----MySite
|-------Public
|----------index.html
And the caddyfile configuration is
:9000 {
root FolderofMyStaticSite/MySite/
log mySite
}
subdomain1.domain.com {
gzip
proxy / :7000 {
except /assets /robots.txt
}
}
subdomain2.domain.com {
proxy / :8000 {
max_fails 1
}
}
Then when I go to the browser and open xxx.xxx.xxx.xxx:9000 I get connection refused, why port 9000? it's because I have it only for testing not for production but I need a port to hear that site. What Am I missing? Thanks!

Radiusd server not serving the request

I have set up a radiud server on centos 6.8 and I have a switch that I want to call this radius server for authentication. The switch ip address is 10.2.1.4 which is there in the clients config file. Here is the part of my client conf file
client switch {
ipaddr = 10.2.1.4
secret = testing123
nastype = other
}
Below is the error that I am getting
... adding new socket proxy address * port 55146
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /var/run/radiusd/radiusd.sock
Listening on authentication address 127.0.0.1 port 18120 as server inner-
tunnel
Listening on proxy address * port 1814
Ready to process requests.
Ignoring request to authentication address * port 1812 from unknown client
10.2.1.4 port 1037
Ready to process requests.
Can anyone please help me here?

xrdp with sesman for port redirection

I am using xrdp in Centos.
1) in /etc/xrdp/xrdp.ini I set the port to -1
[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
This is ok. I can login with my user and password.
1) in /etc/xrdp/sesman.ini I want to redirect to port 5902
port 5902: where my vncserver is already running in Xinetd.
How would you configure the sesman.ini to connect to these port 5902?
try to config /etc/xrdp/xrdp.ini, and set port as 5902
[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=5902

Sails.js 0.10.x: How to listen on localhost only?

I would like to pipe all traffic through an NGINX proxy and make sure that the node server won't be accessible directly from the outside.
Node's http module has the ability to listen on a given port on localhost only, is there an option to enable sails.js to do the same?
Simply add this line:
config/local.js
explicitHost: process.env.HOST || 'localhost'
Or you could add a policy:
config/policies.js
module.exports.policies = {
'*': 'isLocal'
}
api/policies/isLocal.coffee
# sessionAuth
#
# #module :: Policy
# #description :: Accept only local connections
# #docs :: http://sailsjs.org/#!documentation/policies
module.exports = (req, res, cb) ->
if req.ip is '127.0.0.1' then cb()
else res.forbidden new Error 'Accept only local connections'
Not sure why you want to use Sails to restrict access to only localhost when you're using nginx as a proxy server (nginx is designed to do what you want). You can use an nginx configuration file to restrict local access to your Sails app.
server {
listen 80;
server_name www.yourSailsApp.com;
...
location / {
allow 127.0.0.1;
deny all;
}
}
You may need to add your site to your HOSTS file /etc/hosts:
127.0.0.1 yourSailsApp.com
Alternatively, you can just find the public IP of your server and use that in the nginx configuration instead, in the allow field.