Score:1

Magento2 website with nginx(with SSL termination) and varnish cache

kz flag

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,

  1. 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?
  2. 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
Score:0
in flag

On question 1: A simple option is to configure nginx to listen to a port on localhost or 127.0.0.1 only and configure the backend in VCL with .host = "localhost"; or .host = "127.0.0.1";. Other options are to use a unix domain socket or an abstract socket (since 7.3 which is coming out next week).

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.