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:
-
Login to Websoft9 Console and find or install NGINX:
- Go to My Apps listing applications
- Go to App Store installing target application
-
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 via the Websoft9 console, view the application details through My Applications and retrieve access information from Access.
-
Refer to "Deploying Applications Based on a Programmatic Environment (runtime)" to deploy a static website.
Reverse Proxy Other Applications
Follow these steps to experience the capabilities of NGINX as a directional proxy:
-
Run Netdata and Caddy from 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;
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 should see the application pointing to the Netdata page.
On the Websoft9 hosting platform, the above Netdata access is routed as follows: User > Websoft9 Gateway > NGINX > Netdata
Configuration Options
- NGINX application root directory (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
Administration
Troubleshooting
Enable Gzip for HTML, CSS, JS?
By default, NGINX does not enable Gzip. 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 500;