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
Table of contents 1. Click on the menu to jump 1....
npm uninstall sudo npm uninstall npm -g If you en...
As more and more Docker images are used, there ne...
In fact, this problem has already popped up when I...
Demand background The project is made using Vue, ...
Problem Description After installing the plugin E...
1. System Configuration 1. Turn off sudo password...
1. Introduction to Navicat 1. What is Navicat? Na...
You can often see articles about CSS drawing, suc...
1. Use frameset, frame and iframe to realize mult...
Table of contents 1. Get a random Boolean value (...
When writing the HTTP module of nginx, it is nece...
Table of contents Preface: accomplish: Summarize:...
Due to your company standards, you may only allow...
1. Problem Multiple floating elements cannot expa...