Ubuntu Install nginx Configure reverse proxy server

Source: Internet
Author: User

Install Nginx:

sudo apt-get install Nginx

Start Nginx;

sudo service nginx start

If this 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/et C/nginx/nginx.conf:1nginx:the configuration file/etc/nginx/nginx.conf syntax is OK2015/01/16 15:55:46 [Emerg] 1973#0:o Pen () "/var/run/nginx.pid" failed (13:permission denied) nginx:configuration file/etc/nginx/nginx.conf test failed

Either the file is not created or the permission is not present. So:

Create files and folders with Touch and mkdir first. Then use the sudo chmod a+rwx-r file path to give all users all permissions (777).

Finally, under HTTP in the nginx.conf file, add

Upstream MyProject (address alias for the intranet map) {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 map address alias);}}
OK, now start the server with the service nginx Start command. Then enter http://localhost:8088 to see if it is successful.

Ubuntu Install nginx Configure reverse proxy server

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.