nginx doesn't serve files
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have copied a directory into /var/www
named mysite
; then I created a file in sites-available
in order to setup configuration to point to this directory (/etc/nginx/sites-available/mysite
) and a symlink of it in sites-enabled
(/etc/nginx/sites-enabled/mysite
):
server
listen 4000 default_server;
listen [::]:4000 default_server;
root /var/www/otsui;
index index.html;
server_name _;
location /
try_files $uri $uri/ =404;
But when I try to get http://localhost:4000/
, I get This site canâÂÂt be reached
page which means nothing is being served.
I have also tried restarting nginx
service.
I have a debian jessie.
These are my firewalls:
root@mylab:/var/www# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (2 references)
target prot opt source destination
Chain DOCKER-ISOLATION (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
I have also tried copying my web-site files into the default directory, i.e. /var/www/html
; but navigating to http://127.0.0.1:3000/
in the browser still shows me nginx
welcome page, even though I made a restart to the nginx
service.
debian services nginx
add a comment |Â
up vote
1
down vote
favorite
I have copied a directory into /var/www
named mysite
; then I created a file in sites-available
in order to setup configuration to point to this directory (/etc/nginx/sites-available/mysite
) and a symlink of it in sites-enabled
(/etc/nginx/sites-enabled/mysite
):
server
listen 4000 default_server;
listen [::]:4000 default_server;
root /var/www/otsui;
index index.html;
server_name _;
location /
try_files $uri $uri/ =404;
But when I try to get http://localhost:4000/
, I get This site canâÂÂt be reached
page which means nothing is being served.
I have also tried restarting nginx
service.
I have a debian jessie.
These are my firewalls:
root@mylab:/var/www# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (2 references)
target prot opt source destination
Chain DOCKER-ISOLATION (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
I have also tried copying my web-site files into the default directory, i.e. /var/www/html
; but navigating to http://127.0.0.1:3000/
in the browser still shows me nginx
welcome page, even though I made a restart to the nginx
service.
debian services nginx
1
Test the configuration usingnginx -T
. Butindex.html;
is not a legal statement, did you meanindex index.html;
?
â Richard Smith
Nov 18 '17 at 14:13
Perhaps stating the obvious, but is there a firewall active? Typeiptables -L
(as root) to check.
â maulinglawns
Nov 18 '17 at 14:29
@RichardSmith, my mistake. I fixed it, but still same results happen.
â Zeinab Abbasimazar
Nov 20 '17 at 5:45
@maulinglawns, nothing to worry about, I think. But I will post it in the question. Would you please check it?
â Zeinab Abbasimazar
Nov 20 '17 at 5:47
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have copied a directory into /var/www
named mysite
; then I created a file in sites-available
in order to setup configuration to point to this directory (/etc/nginx/sites-available/mysite
) and a symlink of it in sites-enabled
(/etc/nginx/sites-enabled/mysite
):
server
listen 4000 default_server;
listen [::]:4000 default_server;
root /var/www/otsui;
index index.html;
server_name _;
location /
try_files $uri $uri/ =404;
But when I try to get http://localhost:4000/
, I get This site canâÂÂt be reached
page which means nothing is being served.
I have also tried restarting nginx
service.
I have a debian jessie.
These are my firewalls:
root@mylab:/var/www# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (2 references)
target prot opt source destination
Chain DOCKER-ISOLATION (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
I have also tried copying my web-site files into the default directory, i.e. /var/www/html
; but navigating to http://127.0.0.1:3000/
in the browser still shows me nginx
welcome page, even though I made a restart to the nginx
service.
debian services nginx
I have copied a directory into /var/www
named mysite
; then I created a file in sites-available
in order to setup configuration to point to this directory (/etc/nginx/sites-available/mysite
) and a symlink of it in sites-enabled
(/etc/nginx/sites-enabled/mysite
):
server
listen 4000 default_server;
listen [::]:4000 default_server;
root /var/www/otsui;
index index.html;
server_name _;
location /
try_files $uri $uri/ =404;
But when I try to get http://localhost:4000/
, I get This site canâÂÂt be reached
page which means nothing is being served.
I have also tried restarting nginx
service.
I have a debian jessie.
These are my firewalls:
root@mylab:/var/www# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (2 references)
target prot opt source destination
Chain DOCKER-ISOLATION (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
I have also tried copying my web-site files into the default directory, i.e. /var/www/html
; but navigating to http://127.0.0.1:3000/
in the browser still shows me nginx
welcome page, even though I made a restart to the nginx
service.
debian services nginx
edited Nov 21 '17 at 5:33
asked Nov 18 '17 at 13:39
Zeinab Abbasimazar
1519
1519
1
Test the configuration usingnginx -T
. Butindex.html;
is not a legal statement, did you meanindex index.html;
?
â Richard Smith
Nov 18 '17 at 14:13
Perhaps stating the obvious, but is there a firewall active? Typeiptables -L
(as root) to check.
â maulinglawns
Nov 18 '17 at 14:29
@RichardSmith, my mistake. I fixed it, but still same results happen.
â Zeinab Abbasimazar
Nov 20 '17 at 5:45
@maulinglawns, nothing to worry about, I think. But I will post it in the question. Would you please check it?
â Zeinab Abbasimazar
Nov 20 '17 at 5:47
add a comment |Â
1
Test the configuration usingnginx -T
. Butindex.html;
is not a legal statement, did you meanindex index.html;
?
â Richard Smith
Nov 18 '17 at 14:13
Perhaps stating the obvious, but is there a firewall active? Typeiptables -L
(as root) to check.
â maulinglawns
Nov 18 '17 at 14:29
@RichardSmith, my mistake. I fixed it, but still same results happen.
â Zeinab Abbasimazar
Nov 20 '17 at 5:45
@maulinglawns, nothing to worry about, I think. But I will post it in the question. Would you please check it?
â Zeinab Abbasimazar
Nov 20 '17 at 5:47
1
1
Test the configuration using
nginx -T
. But index.html;
is not a legal statement, did you mean index index.html;
?â Richard Smith
Nov 18 '17 at 14:13
Test the configuration using
nginx -T
. But index.html;
is not a legal statement, did you mean index index.html;
?â Richard Smith
Nov 18 '17 at 14:13
Perhaps stating the obvious, but is there a firewall active? Type
iptables -L
(as root) to check.â maulinglawns
Nov 18 '17 at 14:29
Perhaps stating the obvious, but is there a firewall active? Type
iptables -L
(as root) to check.â maulinglawns
Nov 18 '17 at 14:29
@RichardSmith, my mistake. I fixed it, but still same results happen.
â Zeinab Abbasimazar
Nov 20 '17 at 5:45
@RichardSmith, my mistake. I fixed it, but still same results happen.
â Zeinab Abbasimazar
Nov 20 '17 at 5:45
@maulinglawns, nothing to worry about, I think. But I will post it in the question. Would you please check it?
â Zeinab Abbasimazar
Nov 20 '17 at 5:47
@maulinglawns, nothing to worry about, I think. But I will post it in the question. Would you please check it?
â Zeinab Abbasimazar
Nov 20 '17 at 5:47
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
I solved the issue; the problem was that I have not included /etc/nginx/sites-enabled/
in /etc/nginx/nginx.conf
in order to load configs from. After a restart
on the nginx
service, my web application was completely deployed.
I should mention that I also checked the output of command nginx -t
in order to be sure every change in the nginx
configurations are OK; the output for a successful re-configuration is:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
BTW, this is my nginx configurations now:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
I solved the issue; the problem was that I have not included /etc/nginx/sites-enabled/
in /etc/nginx/nginx.conf
in order to load configs from. After a restart
on the nginx
service, my web application was completely deployed.
I should mention that I also checked the output of command nginx -t
in order to be sure every change in the nginx
configurations are OK; the output for a successful re-configuration is:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
BTW, this is my nginx configurations now:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
add a comment |Â
up vote
0
down vote
accepted
I solved the issue; the problem was that I have not included /etc/nginx/sites-enabled/
in /etc/nginx/nginx.conf
in order to load configs from. After a restart
on the nginx
service, my web application was completely deployed.
I should mention that I also checked the output of command nginx -t
in order to be sure every change in the nginx
configurations are OK; the output for a successful re-configuration is:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
BTW, this is my nginx configurations now:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I solved the issue; the problem was that I have not included /etc/nginx/sites-enabled/
in /etc/nginx/nginx.conf
in order to load configs from. After a restart
on the nginx
service, my web application was completely deployed.
I should mention that I also checked the output of command nginx -t
in order to be sure every change in the nginx
configurations are OK; the output for a successful re-configuration is:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
BTW, this is my nginx configurations now:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
I solved the issue; the problem was that I have not included /etc/nginx/sites-enabled/
in /etc/nginx/nginx.conf
in order to load configs from. After a restart
on the nginx
service, my web application was completely deployed.
I should mention that I also checked the output of command nginx -t
in order to be sure every change in the nginx
configurations are OK; the output for a successful re-configuration is:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
BTW, this is my nginx configurations now:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
answered Nov 25 '17 at 11:14
Zeinab Abbasimazar
1519
1519
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405433%2fnginx-doesnt-serve-files%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
Test the configuration using
nginx -T
. Butindex.html;
is not a legal statement, did you meanindex index.html;
?â Richard Smith
Nov 18 '17 at 14:13
Perhaps stating the obvious, but is there a firewall active? Type
iptables -L
(as root) to check.â maulinglawns
Nov 18 '17 at 14:29
@RichardSmith, my mistake. I fixed it, but still same results happen.
â Zeinab Abbasimazar
Nov 20 '17 at 5:45
@maulinglawns, nothing to worry about, I think. But I will post it in the question. Would you please check it?
â Zeinab Abbasimazar
Nov 20 '17 at 5:47