Nginx
NGINX is Deployment static website by NGINX, used for HTTP Server HTML . This is NGINX container for HTML/JS Static website deployment, and it can also used for Proxy. NGINX is a high-performance web proxy server with excellent static resource and high concurrency processing capabilities.
Prepare
When referring to this document to use NGINX, please read and ensure the following points:
-
This application is installed by Websoft9 console.
-
The purpose of this application complies with the nginx open source license agreement.
-
Configure the domain name or server security group opens external network ports for application access.
Getting started
Websoft9 provides Nginx applications for two purposes:
- Running static websites directly
- as a reverse proxy service
Below is a detailed description of how to use each of these applications
Deploying a static website
-
After installing NGINX in the Websoft9 console, view the application details through My Applications and get access information in the Access.
-
Refer to Deploying Applications Based on a Programmatic Environment (runtime) to deploy a static website.
Reverse proxy other applications
Refer to the following steps to experience the capabilities of NGINX Directional Proxying:
-
Run a Netdata and Caddy in the Websoft9 console App Store.
-
Modify src/default.conf in My Applications > NGINX > compose > Go to Edit Repository , replacing location / with the following
location / {
proxy_pass http://netdata_h31py:19999;
# Optional proxy settings
proxy_set_header Host $host; # Optional proxy settings.
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;
}
`` -
Restart the NGINX application, access the NGINX URL, and you will see that the application has pointed to the Netdata page
In the Websoft9 hosting platform, the above Netdata access is routed: User > Websoft9 Gateway > NGINX > Netdata
Configuration options
- NGINX application root directory (already mounted): /usr/share/nginx/html
- NGINX Configuration File (mounted): /etc/nginx/conf.d/default.conf
- NGINX maximum number of open files: set by /etc/security/limits.conf.
- NGINX container port: 80
- CLI:
nginx -h
- NGINX Configuration File Generator tool
- Pseudo-static rules template
Administer
Troubleshooting
Enable Gzip for HTML, CSS, JS?
By default Nginx does not enable Gzip, you need to add the following code to the configuration file:
gzip on.
gzip_types application/xml application/json text/css text/javascript application/javascript;
gzip_vary on;
gzip_comp_level 6; gzip_min_length
gzip_vary on; gzip_comp_level 6; gzip_min_length 500.