Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Help configuring nginx file

$
0
0
Hi there,

I have a flex app running on my PC and would like to deploy it to my Virtual server CentoOS 6.5. and make it available to outside world.
I think that I implemented all the steps in this tutorial correctly (https://www.digitalocean.com/community/tutorials/how-to-deploy-flask-web-applications-using-uwsgi-behind-nginx-on-centos-6-4).

However, I am not sure about the configuration of /etc/nginx/nginx.conf ??

My python application files are located under /var/www/vhosts/lvpsx.x.x.x.dedicated.hosteurope.de/cgi-bin/fun
These are main.py as well as the folders static, templates..
I am not sure how to reference my application in /etc/nginx/nginx.conf, here below.

I WOULD BE REALLY GRATEFUL IF YOU COULD HELP ME CONFIGURE THIS FILE!!

-----------------------------------------------------------
worker_processes 1;

events {

worker_connections 1024;

}

http {

sendfile on;

gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript
application/x-javascript
application/atom+xml;

# Configuration containing list of application servers
upstream uwsgicluster {

server 127.0.0.1:8081;
# server 127.0.0.1:8081;
# ..
# .

}

# Configuration for Nginx
server {

# Running port
listen 81; #changed from 80 because this caused nginx to fail to start (port already used by http)

# Settings to by-pass for static files
#location ^~ /static/ {

# Example:
# root /full/path/to/application/static/file/dir;
# root /app/static/;

#}

location = /var/www/vhosts/lvpsx.x.x.x.dedicated.hosteurope.de/cgi-bin/main.py { rewrite ^ /yourapplication/; }
location /yourapplication { try_files $uri @yourapplication; } #??
location @yourapplication {
include uwsgi_params;
uwsgi_param SCRIPT_NAME /yourapplication;
uwsgi_modifier1 30;
uwsgi_pass unix:/tmp/uwsgi.sock;
}

# Serve a static file (ex. favico) outside static dir.
location = /favico.ico {

root /app/favico.ico;

}

# Proxying connections to application servers
location / {

include uwsgi_params;
uwsgi_pass uwsgicluster;

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_set_header X-Forwarded-Host $server_name;

}
}
}
--------------------------------------------------------------------------------------------

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>