LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Nginx not working (https://www.linuxquestions.org/questions/linux-software-2/nginx-not-working-4175700240/)

NginxUser 09-05-2021 10:17 AM

Nginx not working
 
Hello, I'm running a nginx server on Linux Mint 20.2 Cinnamin. When I use Localhost it shows my webpage but when I connect to it through another computer it says it can't connect. Pls Help.

TB0ne 09-05-2021 10:53 AM

Quote:

Originally Posted by NginxUser (Post 6281832)
Hello, I'm running a nginx server on Linux Mint 20.2 Cinnamin. When I use Localhost it shows my webpage but when I connect to it through another computer it says it can't connect. Pls Help.

Please don't use text-speak; read the LQ Rules.

And although we know you're using nginx on Mint 20...we know nothing else. No web browser, other computer details, network details, what you're putting in on the other side, etc. What are you typing in on the other computer to try to access the web page? How are you accessing it on the local computer? Firewalls? SELinux? We need more details.

NginxUser 09-05-2021 12:38 PM

Hey, 1. Im not using text to speach, just in a hurry. 2. on the other end I'm using chrome os to acsses it with all firewalls down.
And The Linux pc is a Lenovo flex 3

TB0ne 09-05-2021 01:36 PM

Quote:

Originally Posted by NginxUser (Post 6281858)
Hey, 1. Im not using text to speach, just in a hurry.

Not text to speech...text-speak. It's "Please" not 'pls'. Read the LQ Rules.
Quote:

2. on the other end I'm using chrome os to acsses it with all firewalls down. And The Linux pc is a Lenovo flex 3
Ok, so now we know it's Chrome...again, what browser? What are you typing in on that browser to try to access your server? What are you typing in on the local host to access it?

Again, without any sort of relevant information we can't even guess. We don't even know what (if any) messages you're getting on whatever browser you're trying to use.

iPad 09-05-2021 01:53 PM

The questioner needs: the Google keywords. What are they?

/r/linux4noobs would have worked infinitely better.

I didn't click on "View Post", to read the missing #2 & #4, sorry.

TB0ne 09-05-2021 02:39 PM

Quote:

Originally Posted by iPad (Post 6281880)
The questioner needs: the Google keywords. What are they?

No, the questioner needs to provide the details. Anything as vague as "not working" has no chance of being answered.
Quote:

/r/linux4noobs would have worked infinitely better.
So why are you here, then?
Quote:

I didn't click on "View Post", to read the missing #2 & #4, sorry.
Perhaps if you did, you'd know what was going on, and the missing details. And as you've been told before, if you can't contribute to a thread, don't post. Saying they need Google keywords and saying post elsewhere doesn't help the OP or answer any questions. And admitting you don't have the facts or know what's been asked isn't good either.

iPad 09-05-2021 02:59 PM

Can anyone *else* help the questioner use Google?

I'll take a guess at the Google:
Quote:

nginx localhost works but other computers can't access
I did find the catb link: http://www.catb.org/~esr/faqs/smart-questions.html
But I don't know how to teach /r/linux4noobs to fix the UNdisplayed posts. Maybe someone else can.

Possibly the IP address is the problem, but that's a blind guess. Do you know ping?

I haven't made the effort to learn to get Mint text-to-speech working, so it's difficult for me to reply, especially without seeing any further info. I'm guessing the UNdisplayed posts are scaring the n00b away, so let's *wait* to see if the questioner ever comes back to LQ.
Quote:

...in a hurry...
They seem to only want the **instant** answers that Google provides. Best wishes. Bye.

jefro 09-05-2021 03:21 PM

Either one or both of these two issues.

One is nat/pat to allow traffic between client and server.
Other tends to be configuration of server.

Would need some info on both.

TB0ne 09-05-2021 04:12 PM

Quote:

Originally Posted by iPad (Post 6281901)
Can anyone *else* help the questioner use Google? I'll take a guess at the Google:
Code:

nginx localhost works but other computers can't access

Did you bother to actually read any of those? They all indicate one or both of the things the OP has been asked about, and what jefro mentioned. And we can't help with either, since the OP hasn't provided any details.
Quote:

I did find the catb link: http://www.catb.org/~esr/faqs/smart-questions.html
Not hard to find, since it's in the posting signature of many here, along with having been given to you several times in the past.
Quote:

But I don't know how to teach /r/linux4noobs to fix the UNdisplayed posts. Maybe someone else can.
Perhaps, but since you're not making sense with that statement, we don't know.
Quote:

Possibly the IP address is the problem, but that's a blind guess. Do you know ping?
...and we're back to you asking the same kinds of questions the OP has been asked several times.
Quote:

I haven't made the effort to learn to get Mint text-to-speech working, so it's difficult for me to reply, especially without seeing any further info. I'm guessing the UNdisplayed posts are scaring the n00b away, so let's *wait* to see if the questioner ever comes back to LQ.
If the OP is scared of/unable to answer basic questions, there isn't much anyone can help them with. However, you still don't provide answers, do you?? Again, grow up with this passive-aggressive junk. Either contribute or don't. Don't keep telling people to use Google.
Quote:

They seem to only want the **instant** answers that Google provides. Best wishes. Bye.
And since they don't provide details, they won't get them there, either.

NginxUser 09-05-2021 04:21 PM

So is this what you need? I am using it as a http server so i connect through http. here is my nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

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

##
# Gzip Settings
##

gzip on;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthentica...pachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

GentleThotSeaMonkey 09-05-2021 05:15 PM

I'm learning here... I think I see the same problem! (simply apt install nginx)

ufw 'inactive'. ping works. (MX; any Deb deriv maybe)

Code:

$ sudo tcpdump ip host 192.168.1.100 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:02:41.850267 IP 192.168.1.100.46512 > 192.168.1.74.80: Flags [S], seq 3592416560, win 29200, options [mss 1460,sackOK,TS val 1707372136 ecr 0,nop,wscale 4], length 0
15:02:41.850400 IP 192.168.1.74.80 > 192.168.1.100.46512: Flags [S.], seq 3053552155, ack 3592416561, win 65160, options [mss 1460,sackOK,TS val 3271480977 ecr 1707372136,nop,wscale 7], length 0
15:02:41.908035 IP 192.168.1.100.46512 > 192.168.1.74.80: Flags [.], ack 1, win 1825, options [nop,nop,TS val 1707372191 ecr 3271480977], length 0

(client telnet manually quit=aborted, or 'connection closed by foreign host', after 30 seconds)

15:03:16.060804 IP 192.168.1.100.46512 > 192.168.1.74.80: Flags [F.], seq 1, ack 1, win 1825, options [nop,nop,TS val 1707406347 ecr 3271480977], length 0
15:03:16.061177 IP 192.168.1.74.80 > 192.168.1.100.46512: Flags [F.], seq 1, ack 2, win 510, options [nop,nop,TS val 3271515188 ecr 1707406347], length 0
15:03:16.078343 IP 192.168.1.100.46512 > 192.168.1.74.80: Flags [.], ack 2, win 1825, options [nop,nop,TS val 1707406349 ecr 3271515188], length 0
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
user@1005PE:/etc/nginx
$

Also happens to other listening port(s), where telnet localhost 111 connects.
**So, I'm guessing it's not nginx/pgm related.

Code:

$ sudo netstat -tpln | egrep '80|111'
tcp        0      0 0.0.0.0:111            0.0.0.0:*              LISTEN      1/systemd         
tcp        0      0 0.0.0.0:80              0.0.0.0:*              LISTEN      24242/nginx: master
tcp6      0      0 :::111                  :::*                    LISTEN      1/systemd         
tcp6      0      0 :::80                  :::*                    LISTEN      24242/nginx: master

Is there some basic concept we're missing? (code-tag note to OP)

TB0ne 09-05-2021 05:36 PM

Quote:

Originally Posted by NginxUser (Post 6281919)
So is this what you need? I am using it as a http server so i connect through http.

No, it isn't, although it doesn't hurt. Again:
  • What are you typing in to the remote browser to try to access your machine??? As in, "http:// <WHAT???>"
  • What are you typing in to your local machine that DOES work?? "http://localhost"? "http://machine-name"? http://<IP address>"??
  • What browser are you using on Chrome OS?
  • What network are these machines connected to? Same network? Different? Internet? Work to home?
  • What message(s)/error(s) are you getting on the browser??? 404? 500? 503?? Anything????
  • Can you ping the IP address of your nginx machine from the Chrome OS system??
  • Can you access any OTHER network services (SSH, FTP, etc.) from the Chrome system.
If you're typing in "http://localhost" on Chrome, that's not going to work, neither is machine-name, unless you have it set up somewhere in a hosts file or local DNS somewhere. Again, these simple questions will let us try to help you. Again, there are a LOT of moving parts here, so looking for something simplistic on Google will pull up thousands of different things...all addressing different problems.

Please answer the simple questions asked several times now.

GentleThotSeaMonkey 09-05-2021 05:46 PM

@GUru1: maybe my situation is same as low-info OP. Did *I* provide sufficient details?

:genuflect:


Added: ooops, tcpdump looks same on successful localhost https://termbin.com/m29k
so maybe I'm lost off in 'left-field' here...
(at least my debugging might be partly useful to someone someday)

p.s.: @NginxUser: can you collect the same:
sudo tcpdump -nnvv ip host <the IP of remote machine>

You can also try, from remote machine: telnet <NginxServer> 80 and enter: GET /
Does that *not* connect? (But does if done on localhost)

EDIT added AFTER #14 (since OP hasn't been back):
It was actually working, just no prompt!
Yup, I totally "fell off of left-field".

I disassembled my car engine, only to discover I hadn't heard it was running ok! Learned a lot tho.

"When the impossible is happening, it isn't". Again.

TB0ne 09-05-2021 06:58 PM

Quote:

Originally Posted by GentleThotSeaMonkey (Post 6281931)
@GUru1: maybe my situation is same as low-info OP. Did *I* provide sufficient details?

No idea who you're talking to, but if you have the same issue, you need to answer the same questions. If you're able to connect to localhost and pull up a web page, you know it's listening and working.

tcpdumps, wireshark, etc., are tools to use *AFTER* you do basic diagnostics and troubleshooting. Ping the machine; try a different service; describe the network. A machine on the same network/VLAN has a totally different set of issues than one that has to be NAT'ed at both ends, runs over the Internet, through firewalls, etc. As of yet, we don't know what they're seeing in the browser; for all we know, it's a 404 message because the web page is misspelled. Or they're keying the machine name in with no hosts entry. Could be incredibly simple or not...but unless you start with BASICS and go forward, it's 1000 times more difficult to diagnose.

Would you like to take your car to the mechanic and have them pull the engine out to 'diagnose' a noise, or would you want them to start it and just look and listen? Plug in the ODB scanner and read codes? Start simple, go from there.
Quote:

Added: ooops, tcpdump looks same on successful localhost https://termbin.com/m29k
so maybe I'm lost off in 'left-field' here... (at least my debugging might be partly useful to someone someday)

p.s.: @NginxUser: can you collect the same: sudo tcpdump -nnvv ip host <the IP of remote machine>

You can also try, from remote machine: telnet <NginxServer> 80 Does that *not* connect? (But does if done on localhost)
Again, a simple ping is all that's needed to verify basic connectivity. You don't need tcpdump to do that. Ping the box.

NginxUser 09-05-2021 09:32 PM

1. http://<Ip Address>
2. http://localhost and http://ip-address
3. Chrome
4. Different and Internet
5. (Chrome error) ERR_ADDRESS_UNREACHABLE
6. How do I (I don't have Linux enabled and I can't)
7. And I don't have a server I can Connect to.


All times are GMT -5. The time now is 02:34 PM.