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
Code <div class="test"> <div&g...
Table of contents 1. Background 2. Local custom i...
IDEA is the most commonly used development tool f...
Table of contents 1.DB,DBMS,SQL 2. Characteristic...
p>Manually start in "Services" and i...
Preface WeChat Mini Programs provide new open cap...
Preface The role of process management: Determine...
1. Demand We have three tables. We need to classi...
Theoretically, the memory used by MySQL = global ...
This article introduces the effect of website pro...
HTML Part Copy code The code is as follows: <!D...
Change the default style of select, usually throug...
Cross-domain solutions jsonp (simulate get) CORS ...
The operating environment of this tutorial: Windo...
This article example shares the specific code of ...