This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Provide a default nginx-app.conf #139
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,28 +112,26 @@ runtime_config: | |
|
||
## How to change nginx.config | ||
|
||
Put `nginx-app.conf` file which includes piece of nginx configuration | ||
for the `server` section in the project top directory. Then it will be | ||
moved to an appropriate directory and included from the main nginx | ||
configuration file. | ||
We put `nginx-app.conf` file which is included in the `server` section | ||
of the main configuration file. Here is the default configuration file | ||
which will likely just work with most of the modern web frameworks in | ||
simple cases. | ||
|
||
Assumption is that you don't often need to entirely modify the | ||
[default nginx file](nginx.conf). | ||
There is an `include` directive in the `server` section and your | ||
configuration file will be included there. | ||
|
||
Here is an example configuration for silex. | ||
|
||
nginx-app.conf: | ||
The default nginx-app.conf: | ||
|
||
```ini | ||
location / { | ||
# try to serve file directly, fallback to front controller | ||
# try to serve files directly, fallback to the front controller | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
``` | ||
|
||
I hope this mechanism can cover most of the web frameworks, but let us | ||
You might need to add some rewrite rules, or you might want to change | ||
the behavior. In those cases, put a file named `nginx-app.conf` in the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Symfony uses
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this to the suggested edit above. |
||
project root directory. Then the runtime will override the default | ||
file with the file you provided. | ||
|
||
I hope this mechanism can cover most of your use cases, but let us | ||
know if you found otherwise. | ||
|
||
## Change the PHP version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
location / { | ||
# try to serve files directly, fallback to the front controller | ||
try_files $uri /index.php$is_args$args; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hard to read. How about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!