JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS

Publish Your Article Here

How to change default web location path in Nginx?


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 pointing to "html" folder with in Nginx current installed folder. Replace "html": with your desired folder location, like "/usr/java2novice/html"

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

Now save the configuration and restart Nginx. Now Nginx will start serving the html content from your custom folder path.

$ sudo nginx -s stop
$ sudo nginx
<< Previous Program | Next Program >>

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
What is race condition?
A race condition is a situation in which two or more threads or processes are reading or writing some shared data, and the final result depends on the timing of how the threads are scheduled. Race conditions can lead to unpredictable results and subtle program bugs. A thread can prevent this from happening by locking an object. When an object is locked by one thread and another thread tries to call a synchronized method on the same object, the second thread will block until the object is unlocked.
Famous Quotations
It is amazing what you can accomplish if you do not care who gets the credit.
-- Harry Truman

About Author

I'm Nataraja Gootooru, programmer by profession and passionate about technologies. All examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.

If you come across any mistakes or bugs, please email me to [email protected].

Most Visited Pages

Other Interesting Sites

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