Install nginx on ubuntu to configure the reverse proxy server, and use tung.pdf

Source: Internet
Author: User

Install nginx on ubuntu to configure the reverse proxy server, and use tung.pdf

Install nginx:

sudo apt-get install nginx

Start nginx;

sudo service nginx start

If the following error is reported:

[alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)2015/01/16 15:55:46[warn] 1973#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1nginx: the configuration file /etc/nginx/nginx.conf syntax is ok2015/01/16 15:55:46 [emerg] 1973#0: open() "/var/run/nginx.pid" failed (13: Permission denied)nginx: configuration file /etc/nginx/nginx.conf test failed

In this case, either the file is not created or the file is not authorized. Therefore:

Use touch and mkdir to create files and folders. Then, grant all permissions (777) to all users in the sudo chmod a + rwx-R file path ).

Add the following content to the http file in the nginx. conf file:

Upstream myproject (intranet ing address alias) {server 192.168.0.27: 80 (ip: port);} server {listen 8088; server_name localhost; location/{root html; index index.html index.htm; proxy_pass http: // myproject (intranet ing address alias );}}
Now, run the service nginx start command to start the server. Then enter http: // localhost: 8088 to check whether the request is successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.