Apache error Hostname myfirstweb.intweb.net provided via SNI and hostname mysecondweb.intweb.net provided via...











up vote
1
down vote

favorite












I have a server with around 3 websites on the same server.



To make things easier for me, I'm generating the nginx configuration files as well as the apache configuration files with ansible so it's easier and less error prone. and, as you will see below, I'm using the same port for all of them, so pretty much the only things are different on those apache and nginx configuration files are the server name, the root location the website location and where the error logs are going to be placed.



The problem that I see now is that I can't see both websites at the same time, when I open the first website on my browser it opens fine, but when I want to open the second website I get this error:



Your browser sent a request that this server could not understand.



When I see apache logs I see the following error:



[Fri Nov 09 16:17:51.247904 2018] [ssl:error] [pid 18614] AH02032: Hostname myweb.intweb.net provided via SNI and hostname mysecondweb.intweb.net provided via HTTP are different



where mysecondweb.intweb.net is the other website I'm trying to see.



This is my nginx configuration file for one of them, where you can see I'm handling the request to apache:



# Force HTTP requests to HTTPS
server {
listen 80;
server_name myweb.intweb.net;
return 301 https://myweb.intweb.net$request_uri;
}
server {

listen 443 ssl;
root /var/opt/httpd/ifdocs;

server_name myweb.intweb.net ;

# add Strict-Transport-Security to prevent man in the middle attacks
add_header Strict-Transport-Security "max-age=31536000" always;
ssl on;
ssl_certificate /etc/pki/tls/certs/star_intweb_net.pem;
ssl_certificate_key /etc/pki/tls/certs/star_intweb_net.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

access_log /var/log/nginx/iflogs/https/access.log;
error_log /var/log/nginx/iflogs/https/error.log;

###include rewrites/default.conf;


index index.php index.html index.htm;

# Make nginx serve static files instead of Apache
# NOTE this will cause issues with bandwidth accounting as files wont be logged
location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
expires max;
}

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

# proxy the PHP scripts to Apache listening on <serverIP>:8080
location ~ .php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

location ~ /. {
deny all;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}


This is my Apache configuration for the same site:



 <VirtualHost *:4433>

SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/star_intweb_net.crt
SSLCertificateKeyFile /etc/pki/tls/certs/star_intweb_net.key
SSLCertificateCcompanyFile /etc/pki/tls/certs/DigiCertCA.crt

ServerAdmin webmaster@company.com

DocumentRoot /var/opt/httpd/ifdocs

<Directory "/var/opt/httpd/ifdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ServerName myweb.intweb.net

ErrorLog /var/log/httpd/iflogs/http/error.log
CustomLog /var/log/httpd/iflogs/http/access.log combined

# RewriteEngine on

# Include rewrites/default.conf

</VirtualHost>


Thank you for your help in advance!










share|improve this question






















  • Why front Apache by nginx? Both can do the whole thing, so why?
    – Nic3500
    Nov 10 at 3:31






  • 1




    If you want to proxy to a client on localhost, why use https to localhost? Terminate the https in nginx and use http to connect to apache. This will save you encrypting and decrypting to avoid network eavesdroppers on a connection that doesn't touch the network.
    – Cupcake Protocol
    Nov 17 at 0:26










  • @CupcakeProtocol Thank you for your comment, are you saying I should do localhost instead of localhost?
    – VaTo
    Nov 19 at 16:18










  • Stackoverflow seems to have garbled your reply to me. But yes, I'm saying use http://localhost/ instead of https://localhost/
    – Cupcake Protocol
    Nov 27 at 1:00

















up vote
1
down vote

favorite












I have a server with around 3 websites on the same server.



To make things easier for me, I'm generating the nginx configuration files as well as the apache configuration files with ansible so it's easier and less error prone. and, as you will see below, I'm using the same port for all of them, so pretty much the only things are different on those apache and nginx configuration files are the server name, the root location the website location and where the error logs are going to be placed.



The problem that I see now is that I can't see both websites at the same time, when I open the first website on my browser it opens fine, but when I want to open the second website I get this error:



Your browser sent a request that this server could not understand.



When I see apache logs I see the following error:



[Fri Nov 09 16:17:51.247904 2018] [ssl:error] [pid 18614] AH02032: Hostname myweb.intweb.net provided via SNI and hostname mysecondweb.intweb.net provided via HTTP are different



where mysecondweb.intweb.net is the other website I'm trying to see.



This is my nginx configuration file for one of them, where you can see I'm handling the request to apache:



# Force HTTP requests to HTTPS
server {
listen 80;
server_name myweb.intweb.net;
return 301 https://myweb.intweb.net$request_uri;
}
server {

listen 443 ssl;
root /var/opt/httpd/ifdocs;

server_name myweb.intweb.net ;

# add Strict-Transport-Security to prevent man in the middle attacks
add_header Strict-Transport-Security "max-age=31536000" always;
ssl on;
ssl_certificate /etc/pki/tls/certs/star_intweb_net.pem;
ssl_certificate_key /etc/pki/tls/certs/star_intweb_net.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

access_log /var/log/nginx/iflogs/https/access.log;
error_log /var/log/nginx/iflogs/https/error.log;

###include rewrites/default.conf;


index index.php index.html index.htm;

# Make nginx serve static files instead of Apache
# NOTE this will cause issues with bandwidth accounting as files wont be logged
location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
expires max;
}

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

# proxy the PHP scripts to Apache listening on <serverIP>:8080
location ~ .php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

location ~ /. {
deny all;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}


This is my Apache configuration for the same site:



 <VirtualHost *:4433>

SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/star_intweb_net.crt
SSLCertificateKeyFile /etc/pki/tls/certs/star_intweb_net.key
SSLCertificateCcompanyFile /etc/pki/tls/certs/DigiCertCA.crt

ServerAdmin webmaster@company.com

DocumentRoot /var/opt/httpd/ifdocs

<Directory "/var/opt/httpd/ifdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ServerName myweb.intweb.net

ErrorLog /var/log/httpd/iflogs/http/error.log
CustomLog /var/log/httpd/iflogs/http/access.log combined

# RewriteEngine on

# Include rewrites/default.conf

</VirtualHost>


Thank you for your help in advance!










share|improve this question






















  • Why front Apache by nginx? Both can do the whole thing, so why?
    – Nic3500
    Nov 10 at 3:31






  • 1




    If you want to proxy to a client on localhost, why use https to localhost? Terminate the https in nginx and use http to connect to apache. This will save you encrypting and decrypting to avoid network eavesdroppers on a connection that doesn't touch the network.
    – Cupcake Protocol
    Nov 17 at 0:26










  • @CupcakeProtocol Thank you for your comment, are you saying I should do localhost instead of localhost?
    – VaTo
    Nov 19 at 16:18










  • Stackoverflow seems to have garbled your reply to me. But yes, I'm saying use http://localhost/ instead of https://localhost/
    – Cupcake Protocol
    Nov 27 at 1:00















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have a server with around 3 websites on the same server.



To make things easier for me, I'm generating the nginx configuration files as well as the apache configuration files with ansible so it's easier and less error prone. and, as you will see below, I'm using the same port for all of them, so pretty much the only things are different on those apache and nginx configuration files are the server name, the root location the website location and where the error logs are going to be placed.



The problem that I see now is that I can't see both websites at the same time, when I open the first website on my browser it opens fine, but when I want to open the second website I get this error:



Your browser sent a request that this server could not understand.



When I see apache logs I see the following error:



[Fri Nov 09 16:17:51.247904 2018] [ssl:error] [pid 18614] AH02032: Hostname myweb.intweb.net provided via SNI and hostname mysecondweb.intweb.net provided via HTTP are different



where mysecondweb.intweb.net is the other website I'm trying to see.



This is my nginx configuration file for one of them, where you can see I'm handling the request to apache:



# Force HTTP requests to HTTPS
server {
listen 80;
server_name myweb.intweb.net;
return 301 https://myweb.intweb.net$request_uri;
}
server {

listen 443 ssl;
root /var/opt/httpd/ifdocs;

server_name myweb.intweb.net ;

# add Strict-Transport-Security to prevent man in the middle attacks
add_header Strict-Transport-Security "max-age=31536000" always;
ssl on;
ssl_certificate /etc/pki/tls/certs/star_intweb_net.pem;
ssl_certificate_key /etc/pki/tls/certs/star_intweb_net.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

access_log /var/log/nginx/iflogs/https/access.log;
error_log /var/log/nginx/iflogs/https/error.log;

###include rewrites/default.conf;


index index.php index.html index.htm;

# Make nginx serve static files instead of Apache
# NOTE this will cause issues with bandwidth accounting as files wont be logged
location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
expires max;
}

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

# proxy the PHP scripts to Apache listening on <serverIP>:8080
location ~ .php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

location ~ /. {
deny all;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}


This is my Apache configuration for the same site:



 <VirtualHost *:4433>

SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/star_intweb_net.crt
SSLCertificateKeyFile /etc/pki/tls/certs/star_intweb_net.key
SSLCertificateCcompanyFile /etc/pki/tls/certs/DigiCertCA.crt

ServerAdmin webmaster@company.com

DocumentRoot /var/opt/httpd/ifdocs

<Directory "/var/opt/httpd/ifdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ServerName myweb.intweb.net

ErrorLog /var/log/httpd/iflogs/http/error.log
CustomLog /var/log/httpd/iflogs/http/access.log combined

# RewriteEngine on

# Include rewrites/default.conf

</VirtualHost>


Thank you for your help in advance!










share|improve this question













I have a server with around 3 websites on the same server.



To make things easier for me, I'm generating the nginx configuration files as well as the apache configuration files with ansible so it's easier and less error prone. and, as you will see below, I'm using the same port for all of them, so pretty much the only things are different on those apache and nginx configuration files are the server name, the root location the website location and where the error logs are going to be placed.



The problem that I see now is that I can't see both websites at the same time, when I open the first website on my browser it opens fine, but when I want to open the second website I get this error:



Your browser sent a request that this server could not understand.



When I see apache logs I see the following error:



[Fri Nov 09 16:17:51.247904 2018] [ssl:error] [pid 18614] AH02032: Hostname myweb.intweb.net provided via SNI and hostname mysecondweb.intweb.net provided via HTTP are different



where mysecondweb.intweb.net is the other website I'm trying to see.



This is my nginx configuration file for one of them, where you can see I'm handling the request to apache:



# Force HTTP requests to HTTPS
server {
listen 80;
server_name myweb.intweb.net;
return 301 https://myweb.intweb.net$request_uri;
}
server {

listen 443 ssl;
root /var/opt/httpd/ifdocs;

server_name myweb.intweb.net ;

# add Strict-Transport-Security to prevent man in the middle attacks
add_header Strict-Transport-Security "max-age=31536000" always;
ssl on;
ssl_certificate /etc/pki/tls/certs/star_intweb_net.pem;
ssl_certificate_key /etc/pki/tls/certs/star_intweb_net.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

access_log /var/log/nginx/iflogs/https/access.log;
error_log /var/log/nginx/iflogs/https/error.log;

###include rewrites/default.conf;


index index.php index.html index.htm;

# Make nginx serve static files instead of Apache
# NOTE this will cause issues with bandwidth accounting as files wont be logged
location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
expires max;
}

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

# proxy the PHP scripts to Apache listening on <serverIP>:8080
location ~ .php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://127.0.0.1:4433;
}

location ~ /. {
deny all;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}


This is my Apache configuration for the same site:



 <VirtualHost *:4433>

SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/star_intweb_net.crt
SSLCertificateKeyFile /etc/pki/tls/certs/star_intweb_net.key
SSLCertificateCcompanyFile /etc/pki/tls/certs/DigiCertCA.crt

ServerAdmin webmaster@company.com

DocumentRoot /var/opt/httpd/ifdocs

<Directory "/var/opt/httpd/ifdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ServerName myweb.intweb.net

ErrorLog /var/log/httpd/iflogs/http/error.log
CustomLog /var/log/httpd/iflogs/http/access.log combined

# RewriteEngine on

# Include rewrites/default.conf

</VirtualHost>


Thank you for your help in advance!







apache nginx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 23:26









VaTo

1,3821637




1,3821637












  • Why front Apache by nginx? Both can do the whole thing, so why?
    – Nic3500
    Nov 10 at 3:31






  • 1




    If you want to proxy to a client on localhost, why use https to localhost? Terminate the https in nginx and use http to connect to apache. This will save you encrypting and decrypting to avoid network eavesdroppers on a connection that doesn't touch the network.
    – Cupcake Protocol
    Nov 17 at 0:26










  • @CupcakeProtocol Thank you for your comment, are you saying I should do localhost instead of localhost?
    – VaTo
    Nov 19 at 16:18










  • Stackoverflow seems to have garbled your reply to me. But yes, I'm saying use http://localhost/ instead of https://localhost/
    – Cupcake Protocol
    Nov 27 at 1:00




















  • Why front Apache by nginx? Both can do the whole thing, so why?
    – Nic3500
    Nov 10 at 3:31






  • 1




    If you want to proxy to a client on localhost, why use https to localhost? Terminate the https in nginx and use http to connect to apache. This will save you encrypting and decrypting to avoid network eavesdroppers on a connection that doesn't touch the network.
    – Cupcake Protocol
    Nov 17 at 0:26










  • @CupcakeProtocol Thank you for your comment, are you saying I should do localhost instead of localhost?
    – VaTo
    Nov 19 at 16:18










  • Stackoverflow seems to have garbled your reply to me. But yes, I'm saying use http://localhost/ instead of https://localhost/
    – Cupcake Protocol
    Nov 27 at 1:00


















Why front Apache by nginx? Both can do the whole thing, so why?
– Nic3500
Nov 10 at 3:31




Why front Apache by nginx? Both can do the whole thing, so why?
– Nic3500
Nov 10 at 3:31




1




1




If you want to proxy to a client on localhost, why use https to localhost? Terminate the https in nginx and use http to connect to apache. This will save you encrypting and decrypting to avoid network eavesdroppers on a connection that doesn't touch the network.
– Cupcake Protocol
Nov 17 at 0:26




If you want to proxy to a client on localhost, why use https to localhost? Terminate the https in nginx and use http to connect to apache. This will save you encrypting and decrypting to avoid network eavesdroppers on a connection that doesn't touch the network.
– Cupcake Protocol
Nov 17 at 0:26












@CupcakeProtocol Thank you for your comment, are you saying I should do localhost instead of localhost?
– VaTo
Nov 19 at 16:18




@CupcakeProtocol Thank you for your comment, are you saying I should do localhost instead of localhost?
– VaTo
Nov 19 at 16:18












Stackoverflow seems to have garbled your reply to me. But yes, I'm saying use http://localhost/ instead of https://localhost/
– Cupcake Protocol
Nov 27 at 1:00






Stackoverflow seems to have garbled your reply to me. But yes, I'm saying use http://localhost/ instead of https://localhost/
– Cupcake Protocol
Nov 27 at 1:00



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234527%2fapache-error-hostname-myfirstweb-intweb-net-provided-via-sni-and-hostname-myseco%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234527%2fapache-error-hostname-myfirstweb-intweb-net-provided-via-sni-and-hostname-myseco%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Landwehr

Reims

Javascript gets undefined on array