nginx redirect non existed sub-domain to named subdomains issueHelp needed setting up nginx to serve static...
Doesn't allowing a user mode program to access kernel space memory and execute the IN and OUT instructions defeat the purpose of having CPU modes?
Vocabulary for giving just numbers, not a full answer
Specifying a starting column with colortbl package and xcolor
Would an aboleth's Phantasmal Force lair action be affected by Counterspell, Dispel Magic, and/or Slow?
What will happen if my luggage gets delayed?
What is this diamond of every day?
What do *foreign films* mean for an American?
Street obstacles in New Zealand
Can we track matter through time by looking at different depths in space?
Why couldn't the separatists legally leave the Republic?
Does a difference of tense count as a difference of meaning in a minimal pair?
Trig Subsitution When There's No Square Root
How do spaceships determine each other's mass in space?
Expressing logarithmic equations without logs
Can I use a violin G string for D?
How many characters using PHB rules does it take to be able to have access to any PHB spell at the start of an adventuring day?
How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?
What is better: yes / no radio, or simple checkbox?
Does "Until when" sound natural for native speakers?
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
How to check whether module is loaded with custom configurations?
What ability score modifier does a javelin's damage use?
Outlet with 3 sets of wires
Whose blood did Carol Danver's receive, Mar-vell's or Yon-Rogg's in the movie?
nginx redirect non existed sub-domain to named subdomains issue
Help needed setting up nginx to serve static filesnginx redirect issue with upstream configurationNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breaknginx reverse proxy hide login query also on 301 redirect or full qualified urlConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errors
Let's say I have the following domains:
example.com in cloudflare
with these subdomains:
test1.example.com
test2.example.com
...
test10.example.com
test1.example.com is accessable with https or http and test2 to test10 are working well with http. I installed letsencrypt wildcard ssl on test1.example.com with this command
sudo certbot --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns --installer nginx -d nexlabs.better.hr
Here is the issue come. Before I installed letsencrypt, when user go non-existance domains like gggg.example.com and hhhh.example.com, they get served by the standard nginx index.html. After I installed letsencrypt when someone enter domain like gggg.example.com , it automatically redirect to test1.example.com. I don't want to happen like this .
and here is my nginx conf file for this
upstream test1_api {
server < some_ip >:8523;
}
upstream test1_dashboard {
server < some_ip >:3523;
}
server {
listen 443 ssl;
server_name test1.example.com;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; managed by Certbot
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name test1.better.hr;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Please help me to find out the issue .
nginx ssl-certificate
add a comment |
Let's say I have the following domains:
example.com in cloudflare
with these subdomains:
test1.example.com
test2.example.com
...
test10.example.com
test1.example.com is accessable with https or http and test2 to test10 are working well with http. I installed letsencrypt wildcard ssl on test1.example.com with this command
sudo certbot --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns --installer nginx -d nexlabs.better.hr
Here is the issue come. Before I installed letsencrypt, when user go non-existance domains like gggg.example.com and hhhh.example.com, they get served by the standard nginx index.html. After I installed letsencrypt when someone enter domain like gggg.example.com , it automatically redirect to test1.example.com. I don't want to happen like this .
and here is my nginx conf file for this
upstream test1_api {
server < some_ip >:8523;
}
upstream test1_dashboard {
server < some_ip >:3523;
}
server {
listen 443 ssl;
server_name test1.example.com;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; managed by Certbot
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name test1.better.hr;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Please help me to find out the issue .
nginx ssl-certificate
add a comment |
Let's say I have the following domains:
example.com in cloudflare
with these subdomains:
test1.example.com
test2.example.com
...
test10.example.com
test1.example.com is accessable with https or http and test2 to test10 are working well with http. I installed letsencrypt wildcard ssl on test1.example.com with this command
sudo certbot --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns --installer nginx -d nexlabs.better.hr
Here is the issue come. Before I installed letsencrypt, when user go non-existance domains like gggg.example.com and hhhh.example.com, they get served by the standard nginx index.html. After I installed letsencrypt when someone enter domain like gggg.example.com , it automatically redirect to test1.example.com. I don't want to happen like this .
and here is my nginx conf file for this
upstream test1_api {
server < some_ip >:8523;
}
upstream test1_dashboard {
server < some_ip >:3523;
}
server {
listen 443 ssl;
server_name test1.example.com;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; managed by Certbot
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name test1.better.hr;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Please help me to find out the issue .
nginx ssl-certificate
Let's say I have the following domains:
example.com in cloudflare
with these subdomains:
test1.example.com
test2.example.com
...
test10.example.com
test1.example.com is accessable with https or http and test2 to test10 are working well with http. I installed letsencrypt wildcard ssl on test1.example.com with this command
sudo certbot --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns --installer nginx -d nexlabs.better.hr
Here is the issue come. Before I installed letsencrypt, when user go non-existance domains like gggg.example.com and hhhh.example.com, they get served by the standard nginx index.html. After I installed letsencrypt when someone enter domain like gggg.example.com , it automatically redirect to test1.example.com. I don't want to happen like this .
and here is my nginx conf file for this
upstream test1_api {
server < some_ip >:8523;
}
upstream test1_dashboard {
server < some_ip >:3523;
}
server {
listen 443 ssl;
server_name test1.example.com;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; managed by Certbot
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name test1.better.hr;
access_log /var/log/nginx/log/test1/access.log;
error_log /var/log/nginx/log/test1/error.log;
index index.html index.htm;
location / {
proxy_pass http://test1_dashboard;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://test1_api/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Please help me to find out the issue .
nginx ssl-certificate
nginx ssl-certificate
asked 4 mins ago
wai yan win htainwai yan win htain
1
1
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957669%2fnginx-redirect-non-existed-sub-domain-to-named-subdomains-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957669%2fnginx-redirect-non-existed-sub-domain-to-named-subdomains-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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