I have hosted Magento2 website with Nginx, SSL termination, and Varnish cache.
Varnish cache is running on port 8080 and the Magento2 website is hosted on Nginx port 8081. Http and Https traffic is accepted by the same Nginx and forwarded to the varnish cache(SSL terminated).
I have two questions,
- If I tried to access the Magento2 website which is running on port 8081, directly from the internet, it bypasses the SSL termination and directly connects to the website. How can I restrict that?
- When configuring magento2 baseurl, If I want to host it on a
different port rather than the default 80 port, Do I need to give
the port number at the baseurl configuring step? eg:-
php bin/magento setup:install --base-url=http://www.example.com:8081