image.png
Perfect is a complete and powerful toolbox, framework and application server for Linux, iOS and MacOS (OS X). It provides everything that Swift engineers need to develop lightweight, maintainable, and extensible applications and other REST services for the Swift programming language for client and server-side applications.
In the next few articles I will record the Perfect framework. Those interested can see:
Swift Perfect-Ubuntu server deploymentSwift Perfect-Qiniu upload files[Swift Perfect-iOS Message Push (APNs) to obtain APNs authorization code] (https://www.jianshu.com/p/3058d80761e8)Swift Perfect-Run in the background using the systemd command server projectInstallation and deployment of Nginx in Ubuntu environmentSwift Perfect-Nginx configure HTTPS server
sudo apt-get install nginx
vi /etc/nginx/nginx.conf
Find the http {... }
area and add the following server configuration:
server {
listen 80;
server_name www.domain.com; # www.domain.com domain
location /{
proxy_pass http://localhost:8080; #Corresponding to port number 8080}}
E.g:
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
server {
listen 80;
server_name www.domain.com;
location /{
proxy_pass http://localhost:8080;}}}
nginx -t -c /etc/nginx/nginx.conf
image.png
/etc/init.d/nginx restart
image.png
Recommended Posts