Nginx Web Server Setup

  • create site configuration file
$ sudo touch /etc/nginx/sites-available/slim_unified_client_rest
  • /etc/nginx/sites-available/slim_unified_client_rest

    server {
    listen 80;
    server_name 127.0.0.1;
    location = /favicon.ico { access_log off; log_not_found off; }
    
    # uwsgi-apps
    location / {
      include     uwsgi_params;
      uwsgi_pass  unix:/run/uwsgi/slim_unified_client_rest.sock;
    }
    }
    
  • create symbolic link into site-enabled

$ sudo ln -s /etc/nginx/sites-available/slim_unified_client_rest /etc/nginx/sites-enabled

$ sudo unlink /etc/nginx/sites-enabled/slim_unified_client_rest

$ sudo ln -s /etc/nginx/sites-available/slim_unified_client_rest /etc/nginx/sites-enabled
  • check the configuration and run
$ sudo nginx -t

$ sudo systemctl restart nginx.service
  • inspect the web service
$ curl -X GET 127.0.0.1:80

$ curl -X POST 127.0.0.1:80 -d '{
    "image_urls": [
        "https://upload.wikimedia.org/wikipedia/commons/d/d9/First_Student_IC_school_bus_202076.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Labrador_Retriever_portrait.jpg/1200px-Labrador_Retriever_portrait.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/f/fd/Qantas_a380_vh-oqa_takeoff_heathrow_arp.jpg"
    ]
}'

results matching ""

    No results matching ""