Welcome! Log In Create A New Profile

Advanced

how to access my server from local network

Posted by Yashko 
how to access my server from local network
October 16, 2014 08:34AM
hi.
i installed nginx and i can access my website only from my PC.
how to make to access website from another PC in my local network?
Re: how to access my server from local network
October 16, 2014 09:08AM
http://ip-address-of-pc-running-nginx/

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: how to access my server from local network
October 16, 2014 09:58AM
not working for me


#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

pid temp/nginx.pid;


events {
worker_connections 1024;
}


http {
include 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 logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

client_max_body_size 55m;

#gzip on;

scgi_temp_path temp/uwsgi_temp 1 2;
uwsgi_temp_path temp/uwsgi_temp 1 2;

fastcgi_connect_timeout 1;


server {
listen 127.0.0.1:80;

root home/localhost/public_html;
index index.php index.html;

log_not_found off;
charset utf-8;

access_log logs/access.log main;

location ~ /\. {deny all;}

location / {

if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}

}

location ~ \.php$ {

if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}

if (!-e $document_root$document_uri){return 404;}
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}
}

server {
listen 127.0.0.1:443;
include ssl.conf;

root home/localhost/public_html;
index index.php index.html;

log_not_found off;
charset utf-8;

access_log logs/access.log main;

location ~ /\. {deny all;}

location / {

if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}

}

location ~ \.php$ {

if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}

if (!-e $document_root$document_uri){return 404;}
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}
}


include tools-*.conf;

include vhosts/*.conf;

}


this is my nginx.conf
Re: how to access my server from local network
October 16, 2014 11:47AM
https://www.linode.com/docs/websites/nginx/basic-nginx-configuration
Scroll down to the listen examples.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: how to access my server from local network
October 16, 2014 12:33PM
doesnt helped
Re: how to access my server from local network
October 16, 2014 01:17PM
Actually read it, you are binding access to localhost only, which prevents other machines from accessing.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: how to access my server from local network
October 16, 2014 02:02PM
english is not my mother-language so it hard to read all information on link you give,
can u say to me what actually i need edit to access my website in local network??
Re: how to access my server from local network
October 16, 2014 02:32PM
Change your listen directive:
listen 80;

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready