The installation of the rpm package is relatively simple and will not be explained here. For C language software, the steps for source code compilation are usually: For nginx, the source code compilation and installation steps are as follows: ./configure -prefix=/usr/local/nginx -with-http_ssl_module /usr/local/nginx/sbin/nginx –v If you need to deploy static pages such as HTML, upload the static file resources to the /usr/local/nginx/html/ directory. Uncomment line 2 and change nobody to root: If the web application needs to support uploading files, you need to set the upper limit of the uploaded files. Add the following to line 18: client_max_body_size 100m; If you need to change the access port of static resources, just modify it in line 37, for example, set it to 8081: If you need to support request forwarding (for example, to access the backend interface in static resources, all requests to access /api are forwarded to the application on port 18080), add the following content to line 49: location /chat/api{ proxy_pass http://127.0.0.1:18080/api; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; } The above configuration forwards all requests containing /chat/api/ in the access path to http://127.0.0.1:18080/api, where chat is the deployed static resource directory. The last two lines of configuration are used to support websocket connections, that is, the ws protocol. With such a configuration, the front-end and back-end of the web application can be separated, that is, the front-end static resources are deployed on port 8081, and the back-end resources are deployed on port 18080. After deployment, you only need to start nginx and the application on port 18080 to access the web application normally. This is the end of this article about Nginx source code compilation and installation. For more relevant Nginx source code compilation and installation content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Use iframe to display weather effects on web pages
>>: Some CSS questions you may be asked during an interview
During the use of mysql, it was found that the nu...
mysql5.6.28 installation and configuration method...
Use ES6 modular development and observer mode to ...
I have never used apache. After I started working...
register The front-end uses axios in vue to pass ...
In the XHTML language, we all know that the ul ta...
Table of contents 1. Basic Introduction to JavaSc...
Table of contents 1. Background 2. What is a virt...
Today, I set up a newly purchased Alibaba Cloud E...
Preface If our business is at a very early stage ...
Method 1: Use the SET PASSWORD command MySQL -u r...
Table of contents 1. First, let’s explain what Re...
When you browse many websites, you will find that ...
This tutorial shares the process of manually inst...
1. RTMP RTMP streaming protocol is a real-time au...