# pai2_nginx.conf

# the upstream component nginx needs to connect to
upstream pai2 {
    # server unix:///home/paiai/work/pai2/pai2/uwsgi/pai2.sock; # for a file socket
    server 127.0.0.1:8888; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name .img.pai.ai .img.xfoto.com.cn; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /  {
        alias /home/paiai/work/pai2/media;  # your Django project's media files - amend as required
    }

    location /photo  {
        alias /home/paiai/work/pai2/media/photo;  # your Django project's media files - amend as required
    }

    location /fly  {
        alias /home/paiai/work/pai2/media/fly;  # your Django project's media files - amend as required
    }
}

# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name .api.pai.ai .api.xfoto.com.cn; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /media  {
        alias /home/paiai/work/pai2/media;  # your Django project's media files - amend as required
    }

    location /static {
        alias /home/paiai/work/pai2/collect_static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        # uwsgi_pass  pai2;
        proxy_pass  http://pai2;
        include     /home/paiai/work/pai2/pai2/uwsgi/uwsgi_params; # the uwsgi_params file you installed
    }
}

# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name .pai.ai .xfoto.com.cn; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /media  {
        alias /home/paiai/work/pai2/media;  # your Django project's media files - amend as required
    }

    location /static {
        alias /home/paiai/work/pai2/collect_static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        # uwsgi_pass  pai2;
        proxy_pass  http://pai2;
        include     /home/paiai/work/pai2/pai2/uwsgi/uwsgi_params; # the uwsgi_params file you installed
    }
}
