4

Virtual hosting is a feature of the HTTP/1.1 protocol, provided by the Host HTTP header RFC 7230, 5.4. Every modern web server supports it, but the configuration directives have a bit different names and formats: Apache HTTP Server (VirtualHost) <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot "/var/www/...


3

Log file retention is the job of rotate and purge scripts, calling logrotate, tmpwatch or find commands. These are intended to automatically keep log file storage from filling up, absent some enormous increase in volume. Usually not much processing here, to keep purge scripts simple. But you could remove some lines while compressing logs. If URIs exist ...


3

The previous very detailed answer inspired to reuse tls-tris to build tiny esni reverse proxy, that actually can terminate TLS 1.3 with ESNI and forward plain traffic to backend of your choice. This allows to easy use ESNI without any modification of web server you are using. The source code and detailed instruction can be found here: esni-rev-proxy


2

DigitalOcean seems to block outgoing mail connections by default. Quote from a DigitalOcean Community Manager on SO: In order to curb spam and abuse, some new user accounts at DigitalOcean have their SMTP ports blocked by default. Unfortunately there are sometimes false positives. It sounds like this might have been the case for you. If you open a ...


2

Do this instead ServerName mydomain.de ServerAlias *.mydomain.de


2

Short answer, they struggled! Sometimes a bit of evolutional history is a good way to understand where we came from and where we are are right now...... A simple web server had to bind to an IP address. So that really meant if you restricted yourself to one port (80) you could only have one real domain per ip address (machine). However you could specify a ...


2

According to Apache docs "The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins." <VirtualHost *:80> ProxyPreserveHost On ProxyPass /test http://10.0.0.100:8080/test ProxyPassReverse /test http://10.0.0.100:8080/test ProxyPass / http://127.0.0.1:8080/ ...


2

One can capture part of the Host header / TLS SNI field into a variable in server_name like this: server_name ~^(?<company>.+)\.app\.com; Later on, the variable can be used in proxy_pass destination: proxy_pass http://192.168.100.100:5000/$company/; It is useful to know the matching rules, which are explained in nginx server names documentation.


2

Docker containers and vHosts aren't the same thing. You'll use Docker to store WordPress app in a container, this container sharing the system's kernel. You can even store a database in the same container. You'll use vHosts in Apache/nginx to make your domain pointing to a specific container by passing the entering request on the Web server in the container. ...


2

In your config file you have: ServerName testapp But in your URL you are using: http://localhost/testapp You will need your DNS server to map testapp to the IP address of your server. Or, edit your /etc/hosts file, adding a line such as: 127.0.0.1 testapp Replace 127.0.0.1 with your server's IP address if you are trying to reach it from a different ...


1

On shared Hostings you had usually and still now have only a FTP Access. You never got and still do not get a SSH access to the actual File Server. The Database if you purchased on is assigned to you on another Database Server which is not guaranteed to be even on the same physical host. If you purchased an Email Account this also was not guaranteed to be ...


1

It should work can you try? <If "-d /var/www/html"> DocumentRoot "/var/www/html" </If> <Else> DocumentRoot "/var/www/html2" </Else>


1

When doing ssl, you should take into account your certificates. For example, if you have a single certificate for both example1.com and example1.org, you could just create a single VirtualHost with a principal ServerName and a secondary (or more) ServerAlias. If you have independent certificates for each domain, you need to split all in their own VirtualHost ...


1

I have not tried myself what you want to accomplish, but if I would have a go at it, I would do it like this: use a permanent redirect to redirect all HTTP traffic to their HTTPS counterparts (as you have done) use a rewriterule in all the 'secondary' virtualhosts to rewrite the requests to be sent to the 'primary' virtualhost in which you accept the ...


1

VirtualHosts in Apache can have their own documentroot. You just need to specify the correct DocumentRoot in each virtualhost's block.


1

The problem is in the second server block. It checks if accessed domain name is example.com, if yes, then it redirects to https://example.com + the original URL path. Otherwise it returns 404. Certbot doesn't do that good job with nginx configurations. Therefore I suggest that you remove the second server block and use the following instead: server { ...


1

I think the problem just needs another pair of eyes. Even ifnyou wanted to, route 53 would not help - the problem is not in DNS if the browsers find the server The ServerName and ServerAlias values should be domain names - not paths. Remove the '/" from the end - I believe that will fix it. As an aside, those RewriteRules don't make sense to me. Maybe they ...


1

With openssl s_client, you set the SNI name with -servername. With the -connect you can specify the ip-adress (or hostname) and port. So this should do the trick: openssl s_client -showcerts -servername example.com -connect localhost:443


1

I already tried some tutorials, e.g. https://www.codersbistro.com/blog/setting-up-ghost-with-apache-http-server/ but they still couldn't help me. The tutorial includes the following part: ProxyPass / http://localhost:2368/ ProxyPassReverse / http://localhost:2368/ Contrary to this your config includes the following ProxyPass / https://127.0.0.1:2368/ ...


1

Since you need to change all the contents of /var/www/vhosts/*/httpdocs/*, you could iterate over the directories inside the /var/www/vhosts/ and for each item execute find for the httpdocs and chmod for files and dirs. for my_hosts in /var/www/vhosts/*/httpdocs; do #DryRun to see the changes find $my_hosts -type f -exec ls -l {}\; find $my_hosts -type d -...


1

# Cookie is set. Send all request to the proxy. RewriteCond %{REQUEST_URI} !^/api(/.*|)$ [NC] RewriteCond %{HTTP_COOKIE} \bexample_cookie=true\b RewriteRule ^/(.*)$ http://proxy-domain.local/$1 [P,L] The first condition is only successful when the REQUEST_URI does not start with /api. However, this condition would seem to be redundant, since you can perform ...


1

The ServerName and all hostnames in the ServerAlias are treated the same i.e. the same configuration applies to all the hostnames specified in both directives on the <VirtualHost> section. The only difference is that the ServerName is used as identification, and cannot therefore contain more than a single hostname. That's why there's a separate ...


1

I cannot leave comments because I'm new but you should look at https://httpd.apache.org/docs/2.4/mod/core.html#usecanonicalname I am assuming you are using Apache and name based virtualhosts Again, sorry I couldn't leave this as a comment.


1

I can't leave comments, I need four more reputation points but I may be able to help. With the information you have provided it's difficult to figure out but as a guide I do the following. I use Nginx as a reverse proxy which caches an Apache on another server but the config should be the same. Before mucking around with your nginx configuration make ...


1

The UseCanonicalName is not related to redirections but to self-referential URLs. Off: "form self-referential URLs using the hostname and port supplied by the client" On: "use the hostname and port specified in the ServerName directive to" The redirection you see is not related to this, but a result of the HSTS policy you have specified with Strict-...


1

The host file (& how it's not related) First, you don't need anything in your hosts file if the authoritative DNS for example.com is pointing to the public IP address of your server. 127.0.0.1 example.com www.example.com This simply overrides the DNS when example.com is used from the same machine. It makes the server to use local loopback instead of ...


1

default server rodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:23) This is your default server i.e. the default virtual host. It is used every time there's no matching explicit ServerName or ServerAlias. That's the case when you visit e.g. http://localhost. port 80 namevhost coderodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:29) alias wwww....


1

You are missing the ProxyPass directive and you have ProxyPassReverse twice, with different values. only one of them will be used. Correct should be: ProxyPass http://127.0.0.1:8181 ProxyPassReverse http://127.0.0.1:8181 And you should have only one single virtualhost: <VirtualHost *:443> ServerName myserver.com DocumentRoot /var/www/html ...


1

Try the following instead: RewriteCond %{HTTP_HOST} ^([^.]+) RewriteRule ^/(.*) https://%1.maindomain.de/$1 [R=301,L] There's no need to check %{HTTPS} !=on since you are in the vHost for port 80. The RewriteCond directive captures just the subdomain from the requested hostname (which can only be autoconfig or autodiscover from the vHost config stated). ...


1

Answering my own question like a weirdo; In order for nginx to make a difference between same paths used by two urls (e.g /), it needs to use proxy_cache_key, which by default seems to be $scheme$proxy_host$request_uri, this doesn't work in my case, when two nginx domains take data from same source server (by sending a different host header), they would ...


Only top voted, non community-wiki answers of a minimum length are eligible