NGINX issue cannot access root
I have setup nginx(non docker container) on host machine
server {
listen 443;
server_name 1.0.0.0.5;
ssl on;
ssl_certificate /etc/nginx/conf/certificate.crt;
ssl_certificate_key /etc/nginx/conf/privateKey.key;
ssl_session_cache shared:SSL:10m;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
location /app{
rewrite ^/app(.*) /$1 break;
proxy_pass http://12x.31.0.121:8100;
}
}
docker container running on port 8100
command:
docker run -d -p 8100:1905 b0abf8a52b08
When I try to access the website it is not able to load the static files. In this scenario how do I define root in NGINX or something else needs to be done?
docker nginx nginx-config
add a comment |
I have setup nginx(non docker container) on host machine
server {
listen 443;
server_name 1.0.0.0.5;
ssl on;
ssl_certificate /etc/nginx/conf/certificate.crt;
ssl_certificate_key /etc/nginx/conf/privateKey.key;
ssl_session_cache shared:SSL:10m;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
location /app{
rewrite ^/app(.*) /$1 break;
proxy_pass http://12x.31.0.121:8100;
}
}
docker container running on port 8100
command:
docker run -d -p 8100:1905 b0abf8a52b08
When I try to access the website it is not able to load the static files. In this scenario how do I define root in NGINX or something else needs to be done?
docker nginx nginx-config
how does your static file path look like?
– Siyu
Nov 22 '18 at 15:31
static files are .css, .js, bower_components, image, etc
– Mamun Arfin
Nov 22 '18 at 17:02
I mean your expected url path to those files
– Siyu
Nov 22 '18 at 17:12
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
– Mamun Arfin
Nov 23 '18 at 14:44
add a comment |
I have setup nginx(non docker container) on host machine
server {
listen 443;
server_name 1.0.0.0.5;
ssl on;
ssl_certificate /etc/nginx/conf/certificate.crt;
ssl_certificate_key /etc/nginx/conf/privateKey.key;
ssl_session_cache shared:SSL:10m;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
location /app{
rewrite ^/app(.*) /$1 break;
proxy_pass http://12x.31.0.121:8100;
}
}
docker container running on port 8100
command:
docker run -d -p 8100:1905 b0abf8a52b08
When I try to access the website it is not able to load the static files. In this scenario how do I define root in NGINX or something else needs to be done?
docker nginx nginx-config
I have setup nginx(non docker container) on host machine
server {
listen 443;
server_name 1.0.0.0.5;
ssl on;
ssl_certificate /etc/nginx/conf/certificate.crt;
ssl_certificate_key /etc/nginx/conf/privateKey.key;
ssl_session_cache shared:SSL:10m;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
location /app{
rewrite ^/app(.*) /$1 break;
proxy_pass http://12x.31.0.121:8100;
}
}
docker container running on port 8100
command:
docker run -d -p 8100:1905 b0abf8a52b08
When I try to access the website it is not able to load the static files. In this scenario how do I define root in NGINX or something else needs to be done?
docker nginx nginx-config
docker nginx nginx-config
asked Nov 22 '18 at 12:22
Mamun ArfinMamun Arfin
45
45
how does your static file path look like?
– Siyu
Nov 22 '18 at 15:31
static files are .css, .js, bower_components, image, etc
– Mamun Arfin
Nov 22 '18 at 17:02
I mean your expected url path to those files
– Siyu
Nov 22 '18 at 17:12
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
– Mamun Arfin
Nov 23 '18 at 14:44
add a comment |
how does your static file path look like?
– Siyu
Nov 22 '18 at 15:31
static files are .css, .js, bower_components, image, etc
– Mamun Arfin
Nov 22 '18 at 17:02
I mean your expected url path to those files
– Siyu
Nov 22 '18 at 17:12
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
– Mamun Arfin
Nov 23 '18 at 14:44
how does your static file path look like?
– Siyu
Nov 22 '18 at 15:31
how does your static file path look like?
– Siyu
Nov 22 '18 at 15:31
static files are .css, .js, bower_components, image, etc
– Mamun Arfin
Nov 22 '18 at 17:02
static files are .css, .js, bower_components, image, etc
– Mamun Arfin
Nov 22 '18 at 17:02
I mean your expected url path to those files
– Siyu
Nov 22 '18 at 17:12
I mean your expected url path to those files
– Siyu
Nov 22 '18 at 17:12
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
– Mamun Arfin
Nov 23 '18 at 14:44
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
– Mamun Arfin
Nov 23 '18 at 14:44
add a comment |
1 Answer
1
active
oldest
votes
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png
but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
That's rewrite ^/app(.*) /$1 break;
striping the url, it cuts out the /app
. Remove it and it will be good to go.
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
add a comment |
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',
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%2fstackoverflow.com%2fquestions%2f53430931%2fnginx-issue-cannot-access-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png
but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
That's rewrite ^/app(.*) /$1 break;
striping the url, it cuts out the /app
. Remove it and it will be good to go.
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
add a comment |
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png
but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
That's rewrite ^/app(.*) /$1 break;
striping the url, it cuts out the /app
. Remove it and it will be good to go.
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
add a comment |
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png
but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
That's rewrite ^/app(.*) /$1 break;
striping the url, it cuts out the /app
. Remove it and it will be good to go.
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png
but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
That's rewrite ^/app(.*) /$1 break;
striping the url, it cuts out the /app
. Remove it and it will be good to go.
answered Nov 23 '18 at 14:49
SiyuSiyu
2,7531927
2,7531927
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
add a comment |
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
I did it but still the same issue is persisting..
– Mamun Arfin
Nov 23 '18 at 15:05
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
did you restarted nginx?
– Siyu
Nov 23 '18 at 15:06
add a comment |
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.
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%2fstackoverflow.com%2fquestions%2f53430931%2fnginx-issue-cannot-access-root%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
how does your static file path look like?
– Siyu
Nov 22 '18 at 15:31
static files are .css, .js, bower_components, image, etc
– Mamun Arfin
Nov 22 '18 at 17:02
I mean your expected url path to those files
– Siyu
Nov 22 '18 at 17:12
it is expecting ->eu-west-1.compute.amazonaws.com/app/Image/data7.png but getting ->eu-west-1.compute.amazonaws.com/Image/data7.png
– Mamun Arfin
Nov 23 '18 at 14:44