phusion / passenger_library

Phusion Passenger documentation
https://www.phusionpassenger.com/docs
Other
48 stars 113 forks source link

Update _nginx_instructions.md.erb #77

Closed Shelagh-Lewins closed 5 years ago

Shelagh-Lewins commented 5 years ago

Added config file for Python, so that passenger_python can be specified. Python apps are commonly built in a virtual environment with a version of Python that is not the system default, so a path to the correct Python executable is required.

scarhand commented 5 years ago

Thanks for making the effort! It seems like this PR is based off the master branch. The master branch contains the old library/documentation. That version of the documentation is no longer actively maintained, and we've done our very best to remove all references to it.

You can try to rebase onto the docs_2018 branch, but there have been a lot of changes and it'll probably be a painful experience... Maybe it's easier if you create a new PR on the docs_2018 branch. Assuming this still applies to the new docs, of course :)

Sorry for the inconvenience!

Shelagh-Lewins commented 5 years ago

Ah! I didn't come across the new docs in web searches, only the old ones.

Yes, I see this issue in the current documenation: https://www.phusionpassenger.com/docs/tutorials/deploy_to_production/deploying_your_app/oss/digital_ocean/python/nginx/

I'm sorry, I can't figure out how to update the new docs, the structure is different and it's not obvious to me how to make the change. My suggestion is to add something like this for Python, similar to the Ruby instructions:

  <pre class="highlight">server {
     listen 80;
     server_name <span class="o">yourserver.com</span>;

     <span class="c"># Tell Nginx and Passenger where your app's 'public' directory is</span>
     root <span class="o">/var/www/myapp/code</span>/public;

     <span class="c"># Turn on Passenger</span>
     passenger_enabled on;
     passenger_python <span class="o">/path-to-python</span>;
 }</pre>

   Replace `yourserver.com` with your server's host name, and replace `/var/www/myapp/code` with your application's code directory path. However, make sure that Nginx is configured to point to the `public` subdirectory inside it!

   Replace `/path-to-python` with the location of the Python executable for the version with which the app was built. This is likely to be the folder containing the virtual environment.

Do you want me to add this as an issue to the new docs?

scarhand commented 5 years ago

Yeah, we did our best to remove as many references to the old library as possible, but we didn't take the page ranking in Google into account...

It seems like a good suggestion, if you like we can apply it to the new docs, and reference you in the commit. Would you be ok with that?

Shelagh-Lewins commented 5 years ago

Thank you, that would be great!

Passenger is awesome and your excellent documentation makes a massive difference to developers.

scarhand commented 5 years ago

Thanks for your contribution! I've updated the docs and deployed them. I made a minor addition and also mentioned the startup_file.