JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS

Publish Your Article Here

How to change Nginx default port?


You can find Nginx configurations on nginx.conf file.

# Default locaction in mac if you have installed it through homebrew:

	/usr/local/etc/nginx/nginx.conf

# Possible locations on Unix or Linux

	/etc/nginx/nginx.conf
	/opt/nginx/conf/

Open the configuration file: nginx.conf and locate below piece of configuration.

server {
	listen       8080;
	server_name  localhost;
	
	location / {
	    root   html;
	    index  index.html index.htm;
	}
}

As per the above configuration Nginx is listening to port 8080. Now change the port to 80 as shown below:

server {
	listen       80;
	server_name  localhost;
	
	location / {
	    root   html;
	    index  index.html index.htm;
	}
}

Now save the configuration and restart Nginx.

$ sudo nginx -s stop
$ sudo nginx

Test it by opening below URL in any brower:

http://localhost
<< Previous Program | Next Program >>
blog comments powered by Disqus

Nginx Basic Configurations

  1. How to install Nginx on Mac OS?
  2. How to start / stop Nginx?
  3. How to change Nginx default port?
  4. How to change default web location path in Nginx?
  5. Configure serving static content with Nginx
  6. How to configure error logs with Nginx?
Knowledge Centre
Java class can be private?
We can not declare top level class as private. Java allows only public and default modifier for top level classes in java. Inner classes can be private.
Famous Quotations
You can never get enough of what you don’t really need.
-- Eric Hoffer

About Author

Most Visited Pages

Other Interesting Sites

Reference: Java™ Platform Standard Ed. 7 - API Specification | Java is registered trademark of Oracle.
Privacy Policy | Copyright © 2017 by Nataraja Gootooru. All Rights Reserved.