WebFaction
Community site: login faq

I'm using a custom app running web2py through uWSGI to serve my web site through the front-end shared nginx server for minimal RAM usage. I want to properly 301 from www.domain.com to domain.com for proper SEO practices.

Is there a way to do this using the shared nginx instance or must I build and run my own web server for this kind of configuration?

I'd really rather not run my own nginx server as it more than doubles my RAM usage. Using the front-end nginx instance with uWSGI leaves me much more RAM for uWSGI to work.

asked 28 Dec '12, 15:24

HittingSmoke
4822030
accept rate: 8%


You have to build your own web-server which can make 301s, the front-end nginx server has zero configuration options.

permanent link

answered 28 Dec '12, 17:09

johns
5.3k312
accept rate: 23%

I was afraid of that. Well I set up a new static app to send all www.* domains to which has a universal mod_rewrite entry to 301 to a san-www URL. That will work for now I guess.

(28 Dec '12, 17:17) HittingSmoke

That's actually the way we recommend you do it: Redirect a Domain with a Static/CGI/PHP App

(28 Dec '12, 17:44) seanf

I am looking for a way to run web2py on webfaction either like you do (with the front-end nginx or just with uWSGI and its built in webserver. I found posts which advice to use the latter because the built in webserver of uWSGI is described as quite fast and should be flexible enough to do all the needing configurations. But as I am very new to all this stuff I haven't got the skills to set up these solutions.

Could you be so kind to tell me how to configure your (the front-end nginx) way. Have you got a shell script for that? I am also very grateful for any hint how to get the pure uWSGI way running.

(29 Dec '12, 03:01) xelomac

If you want to run web2py with uWSGI, a guide for installing uWSGI itself is available here. We don't have any guide for configuring web2py to use wsgi, but that should be available in the web2py documentation.

If you are using web2py's internal webserver instead of using WSGI, then yes, you just need to use a Custom Application (listening on port), and then configure your web2py application to listen on 127.0.0.1:PORT, where PORT is the port assigned to you when you installed the Custom Application (listening on port) and visible in the control panel.

Finally, yes we have an install script for web2py; it's available here. It's not an officially-supported application, though, so if you have trouble with the application you may want to look for help either on the community forums (here) or within the web2py community itself.

(29 Dec '12, 03:37) ryans ♦♦

@ xelomac

I have a script that I've been working on to install web2py using the most efficient memory methods possible that I hope to eventually turn into an xmlrpc deployment script.

I'll put it in a new post when I'm finished as I'm not sure the comments section would handle a full script so gracefully. I'll reply here again once I post it to let you know.

(29 Dec '12, 14:37) HittingSmoke
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×24
×17
×9
×6

question asked: 28 Dec '12, 15:24

question was seen: 3,402 times

last updated: 29 Dec '12, 14:37

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM