Skip to content

Added a note about the .htaccess files included by Symfony apps #7658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
9 changes: 8 additions & 1 deletion setup/web_server_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ The **minimum configuration** to get your application running under Nginx is:
# Remove the internal directive to allow URIs like this
internal;
}

# return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
Expand Down Expand Up @@ -336,6 +336,13 @@ The **minimum configuration** to get your application running under Nginx is:
or ``config.php`` scripts (i.e. ``http://example.com/app_dev.php`` and ``http://example.com/config.php``).
If you *can* access these, be sure to remove the ``DEV`` section from the above configuration.

.. note::

By default, Symfony applications include several ``.htaccess`` files to
configure redirections and to prevent unauthorized access to some sensitive
directories. Those files are only useful when using Apache, so you can
safely remove them when using Nginx.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add that they would better be replaced by a virtual host config for performance reasons.


For advanced Nginx configuration options, read the official `Nginx documentation`_.

.. _`Apache documentation`: http://httpd.apache.org/docs/
Expand Down