Hi Fernando,
I can send you my conf files, if you want to compare, but also you need to
check if your firewall port is open in /etc/iptables.firewall.rules, and
that all files and folders are owned by www-data. If you just installed,
you should also restart uwsgi and nginx. I installed from source, before
this script was finalized, but remember getting the same error as you,
unfortunately don't have in my notes what exactly I did to address this
problem :)

Cheers,
Adnan


This is what i have in mine (just replace xx.xx.xx.xx with your external IP:

*filter

#  Allow all loopback (lo0) traffic and drop all traffic to 127/8 that
doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 -j REJECT

#  Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#  Allow all outbound traffic - you can modify this to only allow certain
traffic
-A OUTPUT -j ACCEPT

#  Allow HTTP and HTTPS connections from anywhere (the normal ports for
websites and SSL).
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

#  Allow SSH connections
#
#  The -dport number should be the same port number you set in sshd_config
#
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# a.s. Nov 22, 10.15am
-A INPUT -p tcp --dport 3306 -j ACCEPT

# a.s. dec 11, 2012 allow for mail server
-A INPUT -p tcp --dport 4343 -j ACCEPT
-A INPUT -p tcp --dport 8080 -j ACCEPT

-A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx --dport 25 -m
state --state NEW,ESTABLISHED -j ACCEPT

-A OUTPUT -p tcp -s xx.xx.xx.xx --sport 25 -d 0/0 --dport 1024:65535 -m
state --state ESTABLISHED -j ACCEPT

#  Allow ping
-A INPUT -p icmp -j ACCEPT

#  Log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: "
--log-level 7

#  Drop all other inbound - default deny unless explicitly allowed policy
-A INPUT -j DROP
-A FORWARD -j DROP

COMMIT






On Thu, Dec 27, 2012 at 10:58 PM, FERNANDO VILLARROEL <fvillarr...@yahoo.com
> wrote:

> Dear Bruno.
>
> Not i am using only http.
>
> maybe I should delete the https config of my nginx file (443).
>
> But i need help for i can config the /etc/uwsgi/administrator.xml for
> deploy the application /home/www-data/web2py/applications/administrator
> with my domain administartor.mydomain.com
>
> Regards.
>
>
> --- On *Thu, 12/27/12, Bruno Rocha <rochacbr...@gmail.com>* wrote:
>
>
> From: Bruno Rocha <rochacbr...@gmail.com>
> Subject: Re: [web2py] Deploy nginx + uwsgi
> To: web2py@googlegroups.com
> Date: Thursday, December 27, 2012, 11:47 PM
>
>
> I see something strange, your 80 port is using IP adress and 443 is using
> unix socket.
>
> Can you access using https:// ??
>
> On Fri, Dec 28, 2012 at 1:43 AM, FERNANDO VILLARROEL <
> fvillarr...@yahoo.com <http://mc/compose?to=fvillarr...@yahoo.com>> wrote:
>
> Dear All.
>
> I am trying to migrated my web2py applications from apache to nginx +
> uwsgi.
>
> So i did configured a Ubuntu Server, i follow the script :
>
>
> http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
>
> My problem is i can't deploy mi domain: administrator.midomain.com, i
> received Bad Gateway.
>
> My /etc/nginx/administrator:
>
>
> server {
>         listen          80;
>         server_name     administrator.mydomain.com;
>         location ~* /(\w+)/static/ {
>            root /home/www-data/web2py/applications/;
>         }
>          location / {
>                 uwsgi_pass      127.0.0.1:9001;
>                 #uwsgi_pass
>  unix:///run/uwsgi/app/web2py/web2py.socket;
>                 include         uwsgi_params;
>                 #uwsgi_param     UWSGI_SCHEME $scheme;
>                 #uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;
>         }
> }
>
> server {
>         listen          443;
>         server_name     administrator.mydomain.com;
>         ssl                     on;
>         ssl_certificate         /etc/nginx/ssl/web2py.crt;
>         ssl_certificate_key     /etc/nginx/ssl/web2py.key;
>         location / {
>                 #uwsgi_pass      127.0.0.1:9001;
>                 uwsgi_pass      unix:///run/uwsgi/app/web2py/web2py.socket;
>                 include         uwsgi_params;
>                 uwsgi_param     UWSGI_SCHEME $scheme;
>                 uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;
>         }
>
> }
>
>
>
> I do not know How should the file /etc/uwsgi/administrator.xml?
>
> My deploy is running ok, when i write my wan IP of my ubuntu server on my
> Browser like Chrome, the welcome application show perfectly, but i told you
> i need help for configuration of  uwsgi for i  can deploy my virtualhost
> like apache:
>
> adminstrator.mydomain.com
>
> The route of the this application administrator is
> /home/www-data/web2py/applications/administrator
>
> I am not using Virtualenv on my ubuntu server.
>
> I hope you help for i can deploy my applications with nginx and uwsgi.
>
> Regards.
>
> Fernando.
>
> --
>
>
>
>
>  --
>
>
>
>
>  --
>
>
>
>



-- 

Thanks,
Adnan

-- 



Reply via email to