Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,70 @@
source_suffix = '.rst'

rst_epilog = """
.. |HttpRewriteModule| replace:: HttpRewriteModule
.. |HttpRewriteModule| replace:: ngx_http_rewrite_module

.. _HttpRewriteModule: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html

.. |HttpAccessModule| replace:: HttpAccessModule

.. |HttpAccessModule| replace:: ngx_http_access_module

.. _HttpAccessModule: http://nginx.org/en/docs/http/ngx_http_access_module.html

.. |HttpLogModule| replace:: HttpLogModule

.. |HttpLogModule| replace:: ngx_http_log_module

.. _HttpLogModule: http://nginx.org/en/docs/http/ngx_http_log_module.html

.. |HttpCoreModule| replace:: HttpCoreModule

.. |HttpCoreModule| replace:: ngx_http_core_module

.. _HttpCoreModule: http://nginx.org/en/docs/http/ngx_http_core_module.html

.. |HttpEchoModule| replace:: HttpEchoModule

.. |HttpEchoModule| replace:: ngx_http_echo_module

.. _HttpEchoModule: http://nginx.org/en/docs/http/ngx_http_echo_module.html

.. |HttpUpstreamModule| replace:: HttpUpstreamModule

.. |HttpUpstreamModule| replace:: /ngx_http_upstream_module

.. _HttpUpstreamModule: http://nginx.org/en/docs/http/ngx_http_upstream_module.html

.. |HttpProxyModule| replace:: HttpProxyModule

.. |HttpProxyModule| replace:: ngx_http_proxy_module

.. _HttpProxyModule: http://nginx.org/en/docs/http/ngx_http_proxy_module.html

.. |HttpFastCGIModule| replace:: HttpFastCGIModule

.. |HttpFastCGIModule| replace:: ngx_http_fastcgi_module

.. _HttpFastCGIModule: http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html

.. |HttpSsiModule| replace:: HttpSsiModule

.. |HttpSsiModule| replace:: ngx_http_ssi_module

.. _HttpSsiModule: http://nginx.org/en/docs/http/ngx_http_ssi_module.html

.. |HttpMapModule| replace:: HttpMapModule

.. |HttpMapModule| replace:: ngx_http_map_module

.. _HttpMapModule: http://nginx.org/en/docs/http/ngx_http_map_module.html

.. |HttpGZipModule| replace:: HttpGZipModule

.. |HttpGZipModule| replace:: ngx_http_gzip_module

.. _HttpGZipModule: http://nginx.org/en/docs/http/ngx_http_gzip_module.html


.. |MailCoreModule| replace:: ngx_mail_core_module

.. ngx_mail_core_module: http://nginx.org/en/docs/mail/ngx_mail_core_module.html


.. |EventsModule| replace:: ngx_http_core_module

.. EventsModule: http://nginx.org/en/docs/http/ngx_http_core_module.html

"""

# The encoding of source files.
Expand Down
4 changes: 2 additions & 2 deletions source/contributing/writing_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ There are internal links as well as external links that are possible.

.. _reference-location:

`Nginx Website <http://nginx.com/>`_
`Nginx Website <https://www.nginx.com/>`_

A link to another document: :doc:`index`

And a link to an :ref:`abritrary reference <reference-location>`

.. _reference-location:

`Nginx Website <http://nginx.com/>`_
`Nginx Website <https://www.nginx.com/>`_

A link to another document: :doc:`index`

Expand Down
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Zappos, Media Temple, Heroku, RightScale, Engine Yard, and many others.
modules/index
contributing/index
start/index
temp/index

.. |moduleicon| replace:: :icon:`puzzle-piece`
.. _moduleicon: modules/index.html
Expand Down
1 change: 0 additions & 1 deletion source/modules/auth_digest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,3 @@ This module is licensed under the terms of the :github:`BSD license <samizdatco/

* The `RFC 2617 <http://www.ietf.org/rfc/rfc2617.txt>`_ definition of basic and digest authentication.
* Shane Holloway's werkzeug `module <https://github.com/shanewholloway/werkzeug/blob/master/werkzeug/contrib/authdigest.py>`_ which was used as a reference implementation.

6 changes: 4 additions & 2 deletions source/modules/circle_gif.rst
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ Where *radius* is the radius in pixels, and the colors are 24-bit hex colors (e.

Installation
------------
You first need the ImageMagick development headers.
You first need the ImageMagick development headers. This module is not distributed with the Nginx source. You can download the circle_gif module :github:`here <evanmiller/nginx_circle_gif>`.

This module is not distributed with the Nginx source. You can download the circle_gif module `here <http://wiki.nginx.org/File:Nginx_circle_gif-0.1.3.tar.gz>`_.
..
Dead link
You can download the circle_gif module `here <http://wiki.nginx.org/File:Nginx_circle_gif-0.1.3.tar.gz>`_.

After extracting, add the following option to your Nginx ``./configure`` command:

Expand Down
Empty file modified source/modules/clojure.rst
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion source/modules/concat.rst
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ size of your platform. On Linux you can get the page size issuing::
Usually is 4k. So if you try to concatenate a lot of files together in
a given context you might hit this barrier. To overcome that OS
defined limitation you must use
the `large_client_header_buffers <http://wiki.nginx.org/NginxHttpCoreModule#large_client_header_buffers>`_
the `large_client_header_buffers <|HttpCoreModule|#large_client_header_buffers>`_
directive. Set it to the value you need.


Expand Down
Empty file modified source/modules/consistent_hash.rst
100755 → 100644
Empty file.
Empty file modified source/modules/domain_resolve.rst
100755 → 100644
Empty file.
Empty file modified source/modules/drizzle.rst
100755 → 100644
Empty file.
Empty file modified source/modules/echo.rst
100755 → 100644
Empty file.
Empty file modified source/modules/extended_status.rst
100755 → 100644
Empty file.
Empty file modified source/modules/fair_balancer.rst
100755 → 100644
Empty file.
Empty file modified source/modules/fancy_index.rst
100755 → 100644
Empty file.
Empty file modified source/modules/foot_filter.rst
100755 → 100644
Empty file.
Empty file modified source/modules/form_input.rst
100755 → 100644
Empty file.
Empty file modified source/modules/groovy_handler.rst
100755 → 100644
Empty file.
Empty file modified source/modules/headers_more.rst
100755 → 100644
Empty file.
Empty file modified source/modules/healthcheck.rst
100755 → 100644
Empty file.
Empty file modified source/modules/iconv.rst
100755 → 100644
Empty file.
Empty file modified source/modules/java_handler.rst
100755 → 100644
Empty file.
Empty file modified source/modules/keepalive.rst
100755 → 100644
Empty file.
Empty file modified source/modules/ketama_chash.rst
100755 → 100644
Empty file.
Empty file modified source/modules/lua.rst
100755 → 100644
Empty file.
Empty file modified source/modules/memc.rst
100755 → 100644
Empty file.
Empty file modified source/modules/mp4_streaming.rst
100755 → 100644
Empty file.
Empty file modified source/modules/owner_match.rst
100755 → 100644
Empty file.
Empty file modified source/modules/push_stream.rst
100755 → 100644
Empty file.
Empty file modified source/modules/rdns.rst
100755 → 100644
Empty file.
Empty file modified source/modules/redis.rst
100755 → 100644
Empty file.
Empty file modified source/modules/redis2.rst
100755 → 100644
Empty file.
Empty file modified source/modules/rrd_graph.rst
100755 → 100644
Empty file.
Empty file modified source/modules/secure_download.rst
100755 → 100644
Empty file.
Empty file modified source/modules/set_misc.rst
100755 → 100644
Empty file.
Empty file modified source/modules/slice.rst
100755 → 100644
Empty file.
Empty file modified source/modules/sr_cache.rst
100755 → 100644
Empty file.
Empty file modified source/modules/substitutions.rst
100755 → 100644
Empty file.
Empty file modified source/modules/upload.rst
100755 → 100644
Empty file.
Empty file modified source/modules/user_agent.rst
100755 → 100644
Empty file.
Empty file modified source/modules/zip.rst
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion source/start/topics/recipes/mybb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Recipe

}

There is a potential security flaw, e.g. if a user uploads an avatar images pic.gif with valid PHP-Code and calls it with /uploades/avatars/pic.gif/foo.php. The issue is discussed `here <http://wiki.nginx.org/Pitfalls#Passing_Uncontrolled_Requests_to_PHP>`_. Because the link is ending with .php, nginx is passing it to the PHP interpreter. PHP can't find the file /uploades/avatars/pic.gif/foo.php, but it tries to be smart and executes /uploades/avatars/pic.gif as an PHP-script. To avoid this, you need to set cgi.fix_pathinfo=0 in your php.ini, which is set to cgi.fix_pathinfo=1 as default (unfortunately).
There is a potential security flaw, e.g. if a user uploads an avatar images pic.gif with valid PHP-Code and calls it with /uploades/avatars/pic.gif/foo.php. The issue is discussed `here <pitfalls.uncontrollable_requests_to_php_>`. Because the link is ending with .php, nginx is passing it to the PHP interpreter. PHP can't find the file /uploades/avatars/pic.gif/foo.php, but it tries to be smart and executes /uploades/avatars/pic.gif as an PHP-script. To avoid this, you need to set cgi.fix_pathinfo=0 in your php.ini, which is set to cgi.fix_pathinfo=1 as default (unfortunately).

See :doc:`../examples/phpfcgi` for details on creating the UNIX socket and `this forum post <http://community.mybb.com/thread-51764.html>`_ on enabling human-understandable (aka SEO-friendly or human-readable) URLs using the Google SEO plugin.

7 changes: 3 additions & 4 deletions source/start/topics/recipes/piwik.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ Piwik
Recipe
------

This configuration file was provided by Seph. You can see the complete information [https://github.com/perusio/piwik-nginx here].
This configuration file was provided by Seph. You can see the complete information :github:`here <perusio/piwik-nginx>`.

.. code-block:: nginx

server {
## This is to avoid the spurious if for sub-domain name
## rewriting. See http://wiki.nginx.org/Pitfalls#Server_Name.
## This is to avoid the spurious if for sub-domain name rewriting.
listen [::]:80;
server_name www.stats.example.com;
rewrite ^ $scheme://stats.example.com$request_uri? permanent;
Expand All @@ -22,7 +21,7 @@ This configuration file was provided by Seph. You can see the complete informati
server_name stats.example.com;

# Parameterization using hostname of access and log filenames.
access_log /var/log/nginx/stats.example.com_access.log;
access_log /var/log/nginx/stats.example.com_access.log;
error_log /var/log/nginx/stats.example.com_error.log;

# Disable all methods besides HEAD, GET and POST.
Expand Down
15 changes: 10 additions & 5 deletions source/start/topics/recipes/silverstripe.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
SilverStripe
============

`SilverStripe <http://www.silverstripe.org/>`_ is a modern PHP based CMS Framework that runs happily on nginx. There are several built in failsafes that will attempt to rectify any errors in rewrite rules. First, SS relies on an .htaccess file to define how to handle URLs. Second, in the event that rewriting has failed the index.php file will attempt to set internal variables and include the core /sapphire/main.php file for processing.
`SilverStripe <http://www.silverstripe.org/>`_ is a modern PHP based CMS Framework that runs happily on nginx.

There are several built in failsafes that will attempt to rectify any errors in rewrite rules.
First, SS relies on an ``.htaccess`` file to define how to handle URLs.
Second, in the event that rewriting has failed the ``index.php`` file will attempt to set internal variables and include the core ``/sapphire/main.php`` file for processing.

.. note::

These instructions assume you are using PHP configured as :doc:`../examples/phpfcgi` or PHP-FPM listening on 127.0.0.1:9000. Make any appropriate changes fastcgi_params as needed for your environment.
These instructions assume you are using PHP configured as :doc:`../examples/phpfcgi` or PHP-FPM listening on 127.0.0.1:9000.
Make any appropriate changes `fastcgi_params <|HttpFastCGIModule|#fastcgi_params>`_ as needed for your environment.

Recipe
------

The basic rewrite that controls all SilverStripe calls involve passing the URI and any GET vars to ``$document_root/framework/main.php``.

# Remove the .htaccess file and index.php in the root of your SilverStripe installation (Just to be sure)
# Apply a config similar to the following:
#. Remove the ``.htaccess`` file and ``index.php`` in the root of your SilverStripe installation (Just to be sure)
#. Apply a config similar to the following:

.. code-block:: nginx

Expand Down Expand Up @@ -64,7 +69,7 @@ The basic rewrite that controls all SilverStripe calls involve passing the URI a
location ~ \.ya?ml$ {
deny all;
}

location ^~ /vendor/ {
deny all;
}
Expand Down
2 changes: 1 addition & 1 deletion source/start/topics/recipes/wordpress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Rewrite rules for Multisite

`WordPress Multisite <http://codex.wordpress.org/Create_A_Network>`_ can be used in multiple ways. Most notably "subdirectories" mode and "subdomains" mode.

Nginx provides 2 special directive: `X-Accel-Redirect <http://wiki.nginx.org/XSendfile>`_ and `map <http://nginx.org/en/docs/http/ngx_http_map_module.html#map>`_. Using these 2 directives, one can eliminate performance hit for static-file serving on WordPress multisite network.
Nginx provides 2 special directive: `X-Accel-Redirect <x-accel.redirect_>` and `map <http://nginx.org/en/docs/http/ngx_http_map_module.html#map>`_. Using these 2 directives, one can eliminate performance hit for static-file serving on WordPress multisite network.

Rewrite rules for Multisite using subdirectories
""""""""""""""""""""""""""""""""""""""""""""""""
Expand Down
8 changes: 2 additions & 6 deletions source/start/topics/tutorials/basics_linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@ section of the tutorial.
Dead links now
- Basic Linux Commands via `Google Code University`_
- Command Line Introduction via `tuxFiles`_
- Learning the Shell via `LinuxCommand`_

- Learning the Shell via `LinuxCommand`_

..
Dead links now
.. _Google Code University: http://code.google.com/edu/tools101/linux/basics.html
.. _tuXfiles: http://www.tuxfiles.org/linuxhelp/cli.html

.. _LinuxCommand: http://linuxcommand.org/learning_the_shell.php
.. _LinuxCommand: http://linuxcommand.org/learning_the_shell.php

CLI Basics
==========
Expand Down
Loading