This is the 27th day of my participation in the August More Text Challenge

Background: Since the project needs to publish ArcGIS Server and terrain data using NGIN agent, the specific operation steps are recorded as follows:

1. Download the nginx software

Nginx is a lightweight Web/reverse proxy server and E-mail (IMAP/POP3) proxy server distributed under the BSD-like protocol. It is characterized by less memory and strong concurrency. In fact, NGINx’s concurrency is better in the same type of web server

The official website is nginx.org/

2. Modify the configuration information

Conf folder nginx.conf configuration information,

The following content is in the configuration file:

server {

        listen       80;

        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

            root   html;

            index  index.html index.htm;

        }
Copy the code

As required:

Upstream arcgis {server http://192.168.1.76:6080/; } server { listen 16165; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { add_header 'Access-Control-Allow-Origin' $http_origin; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,web-token,app-token,Authorization,Accept,Origin,Keep-Alive,User-Agent,X-Mx-ReqToken,X-Data-Type,X-Auth-Token,X-Requ ested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; if ($request_method = 'OPTIONS') { add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain; charset=utf-8'; add_header 'Content-Length' 0; return 204; } #root html/dem/; root html; #index index.html; {} # new location/ag proxy_pass http://192.168.1.76:6080/; Proxy_redirect off; 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_next_upstream error timeout invalid_header http_500 http_504 http_404; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }}Copy the code

3. Place the data

To publish static terrain slice data, place the slice file in the HTML folder under the nginx-1.17.1\ HTML installation directory, as shown above

4. Start nginx

Run the DOS command, locate the nginx directory, and start nginx.exe to start nginx.

5, validation,

(1) Verify arcGIS service agent

To service directory http://192.168.1.76:6080/arcgis/rest/services, nginx 192.168.1.214 deployed to the server, for example.

After the success of the deployment, visit http://192.168.1.76:6080/arcgis/rest/services, access to the results shall conform to the http://192.168.1.214:16165/ag/arcgis/rest/services access to the results.

(2) Verify terrain slice access

http://localhost:16165/dem/layer.json

Ps: use nginx can also configure load balancing, reference blog.csdn.net/warrenwyf/a…