I have spent more than week looking around this site to solve the following two items.
Background: subdomains are setup in GoDaddy DNS to forward to our public IP.
Internally DNS has forward and reverse working for FQDN as well as server on the internal network.
The first item is to allow a subdomain (http or https 80-443)to point to a folder contained inside the FQDN internal server but not display the folder I redirect it to. I have tried several combinations without full success. Meaning the web page is displayed however the folder is also displayed in the browser and is viewable when you click in the URL text field.
I am using this syntax
server {
listen 80;
listen 443;
server_name crm.domain.com;
location = / {
rewrite ^/$ /folder/;
#return 301 domain.com/folder$request_uri;
}
}
Or is this even possible?
The second is direct a subdomain (http or https) to another internal server and apply a port. This redirect also needs to be secure. This is what I have attempted to use but receive errors when checking nginx
server {
server_name pds.domain.com;
listen 80;
listen 443;
location / {
proxy_set_header Host $host;
proxy_pass https//192.168.2.12:9301;
proxy_redirect off;
}
}
The internal server at 192.168.2.12 is sub1.domain.com
Any thoughts on syntax to make this work?