SSRS HTTPS not working for localhost / IP (Bad Request - Invalid Hostname) - reporting-services

I have added https binding to my SSRS but somehow it only work with hostname but not localhost and IP, http is working fine for hostname, localhost and IP.
HTTP
https://mypc:123/Reports -> Working
https://192.168.1.22:123/Reports -> NOT Working (Bad Request - Invalid Hostname)
https://localhost:123/Reports -> NOT Working (Bad Request - Invalid Hostname)
HTTP
http://mypc/Reports -> Working
http://192.168.1.22/Reports -> Working
http://localhost/Reports -> Working
Is the any misconfiguration?
Thanks.

Firstly, make sure you configure your https settings correctly in Report Server Configuration Manager. Second, your https port is 443 and not 123. Ex: https://localhost:443/Reports.

The reason might be that the HTTPS configuration was done using a certificate with CN=mypc; if you want to access the Report Server using IP or LocalHost(For some reason) then try creating a certificate with multiple CN values.
But I don't think its a valid use case as IP might change and localhost might not be accessible from clients.

Related

Why does https://domain-name.example work but www.domain-name.example throws 404 error

Why does https://vivian-duong.gitlab.io work but www.vivian-duong.gitlab.io throw an error?
Here the domain is gitlab.io. But vivian-duong.gitlab.io is the sub domain. The www prefix doesn't work before sub domain. You have to add a CNAME to vivian-duong.gitlab.io to make it work.
Because there is no web server configured to listen for requests for www.vivian-duong.gitlab.io.
It's the same as if you requested non-existant-name.vivian-duong.gitlab.io. As far as the web server is concerned, it's a request for something it doesn't have.
Someone needs to setup the web server to listen and respond to requests for www.vivian-duong.gitlab.io.
DNS is resolving to the correct IP address, however the web server isn't configured to respond to that host header.

Google Cloud HTTP Load Balancer can't connect to my instance

I have created a HTTP load balancer to basically redirect from port 80 to port 8080. The server on my instance is running on port 8080.
I can connect to the server directly but the LB is not able to connect to the instance, both accessing the LB's IP directly and also the health check always fails. The instance group the LB is using consist of just that single instance.
I read Google Compute Engine health checks failing
and the google-address-manager is running. However, when running ip route table list local there is no routing for my LB. The user in the above question is using Network load balancing and not HTTP load balancing (as I am) so I don't know if that is related?
Or perhaps it's related to a firewall? I have added my LB's ip address to a firewall rule that allows tcp:8080
Does anybode have any idea how can I fix this? I am not experienced with debian nor gcp.
Show I just try and run the route add command referenced in the above question? If so, how come the google-address-manager is not adding the route?
Thank you in advance!
You need to make sure that your port mapping on instance group is set to correct port, the 8080 in your case.
First, edit your instance group and change the port name and port to 8080:
Then, navigate to your http backend's settings and change the default port to the port name you've configured in your instance group.
Finally, make sure that your firewall rules allow access on port 8080 from 0.0.0.0/0 or at least from the IP address of HTTP load balancer (130.211.0.0/22)
I had the same issue and fixed it by adding a firewall rule for the health checker (which is not the same IP as your LB!). See https://cloud.google.com/compute/docs/load-balancing/health-checks?hl=en_US#http_and_https_load_balancing for instructions.
In my case, I did not configure the HTTP health check correctly.
I used "/" as path, but on my backend, "/" redirects to a login-page (HTTP 301), which responds with a HTTP 200.
The health check does not follow a redirect, every HTTP response code != 200 is assumed unhealthy (from Debugging Health Checks in Load Balancing on Google Compute Engine).
So, I changed my path to "/login", this fixed my issue.

hotlink working locally, not in server

I want to hotlink an image from a remote website. This works when I test in my local PC (Apache server), but doesn't work when I try from my website.
I am not an expert in this subject, but as I understand if hot-linking was blocked in the remote site, it should not work in my local server as well, right? In that case what might be the issue (my hosting provider is saying they don't have any issue)?
Let's play this through.
On your local server:
You make a request to 127.0.0.1 (or localhost) that returns some HTML with a hotlinked image to example.com.
The browser makes a subsequent request to example.com and sets the referer header to 127.0.0.1.
Now example.com has to determine whether the referrer is allowed to hotlink or not.
Since, for that server, example.com and 127.0.0.1 both refer to the same thing, namely the server itself, this looks like a valid request.
On your remote server:
Same as above, but replace 127.0.0.1 with your.favourite.url.
This time when the server validates the referrer, it will come to the conclusion that your.favourite.url and example.com do not refer to the same thing, and therefore block the image request.
This could be seen as a misconfiguration of example.com, since the referrer might not resolve to the same point from both client and server context.
If you access your local server via your local network IP (e.g. 192.168.1.42), then hotlinking should no longer work, unless example.com has a really graceful referrer policy, or happens to use exactly the same local IP as you.
It could also be possible to expose example.com's local IP by brute-forcing all local network IPs, though while that technically is an information leak, there's not much you can do with it.

Nginx reverse proxy DNS configuration

I am looking to deploy an nginx/dns server on a vps proxy that maps to the real back-end in a different geographical location. The back-end runs apache,mysql,dovecot,postfix. It is a pay-for mail server. The users get entered through apache through php into mysql, and when users set up IMAP, dovecot/postfix pools them from mysql and delivers or uses the smtp outbound.
I read about something in the nginx.conf file, that I can declare the mail hostname on the proxy as so:
mail {
server_name mail.example.com;
...
}
This mail.example.com is the actual mx for the example.com mail exchanger listed in DNS? Here is where that came from:
"As you can see, we declared the name of this server at the top of the mail context.
This is because we want each of our mail services to be addressed as mail.example.
com. Even if the actual hostname of the machine on which NGINX runs is different,
and each mail server has its own hostname, we want this proxy to be a single point
of reference for our users. This hostname will in turn be used wherever NGINX
needs to present its own name, for example, in the initial SMTP server greeting."
So from my understanding, the physical hostname of the proxy should be something else besides mail.example.com. So in DNS on the proxy, I can define that as anyhost.example.com? The proxy also proxies back to my apache on the back-end.
Finally, on the back-end, how do I set up my DNS for that? What hostname do I choose for the actual box running apache,mysql,dovecot,postfix? Its all on one box. I understand that on the registrar, I point 2 nameservers, these should be two proxies, that way running a dig would only pull up the proxies and the MX which should be "known" to be on the proxy.
in your case where all of the services in one box including the proxy, you can set the apache, mysql and other services accessible only from localhost / 127.0.0.1. Then from nginx you put
upstream: 127.0.0.1:80
upstream: 127.0.0.1:3306
therefore the nginx is serving frontend request and forward them to designated services

Localhost 's subdomain with port numbers, how to?

We know that to add a subdomain for localhost, we open and edit the host file by adding lines such as:
127.0.0.1 localhost
127.0.0.1 abc.localhost
127.0.0.1 xyz.localhost
My problem is that: if I browse abc.localhost:88 I get the below error:
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
Why doesn't the URL abc.localhost:88 browse to 127.0.0.1:88 ?
Please help.
Because you need to an entry for abc.localhost to your hosts file. If you already have, then make sure that your webserver is listening on port 88.
If you are using IIS, make sure that you have added a binding to the correct hostname (abc.localhost).
As well as putting the entry in the client's hosts file, you will need to add the appropriate host header abc.localhost to the IIS site that's configured for port 88.
In IIS manager (inetmgr.msc), website properties, website tab, advanced, and add your host header there.