Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DOC-400 customize Nginx is close

  • Loading branch information...
commit 13207787d6116c73e4495c8306b4ec980a35430b 1 parent a7b8b66
@janeday janeday authored
Showing with 45 additions and 17 deletions.
  1. +44 −16 pages/customize-nginx.md
  2. +1 −1  pages/instance-intro.md
View
60 pages/customize-nginx.md
@@ -3,9 +3,9 @@
You might need to customize the default Nginx configuration. This page describes the layout of our Nginx configuration files and lists the files that are not altered by Chef on subsequent runs. These non-altered (customizable) files are straightforward to customize.
You can also customize Nginx with [[custom Chef recipes|custom-chef-recipes]] and with [[keep-files|configuration-keep-files]]; however, this is more difficult.
-**Note:** If you need to create new customized instances that are not based on data volume snapshots of existing customized instances, then you must use custom Chef recipes for your Nginx configuration; *cf.* [Apply Nginx customizations to new or rebuilt instances][2].
+**Note:** If you need to create new customized instances that cannot be based on data volume snapshots of existing customized instances, then you must use custom Chef recipes for your Nginx configuration; *cf.* [Apply Nginx customizations to new or rebuilt instances][2].
-## Customizable files
+<h2 id="topic1"> Customizable files</h2>
These are the files that you can edit without writing a custom Chef recipe or using keep-files:
@@ -17,34 +17,62 @@ These are the files that you can edit without writing a custom Chef recipe or us
* `/etc/nginx/servers/app_name/custom.ssl.conf` - Use this file to add configurations inside the _server_ context of *app_name* that only apply when the request comes in over HTTPS. This file does not exist if SSL is not enabled for your application.
-* `/etc/nginx/servers/app_name.rewrites` - If you use Passenger 2 or Mongrel, use this file. (This file is not used in newer versions of the stack.)
+* `/etc/nginx/servers/app_name.rewrites` - This file is only used by (deprecated) Mongrel.
-<!-- Do you need to say what/how you would use this file if you are on Passenger 2 or Mongrel? Presumably you use it for rewrites... but if that's the case why not just use /etc/nginx/servers/app_name/custom.ssl.conf ? -->
+* `/etc/nginx/servers/default.conf` - This file ensures that Nginx starts. We recommend that you leave it empty.
-* `/etc/nginx/servers/default.conf` - This file ensures that Nginx starts <!-- even? --> if your environment has no configured applications. `/etc/nginx/nginx.conf` tries to include all CONF files under the `servers` directory, so if `/etc/nginx/servers/default.conf` did not exist, Nginx would fail if you removed all applications from an environment. Although you can treat this file in the same way as `http-custom.conf`, we recommend that you leave it empty.
+<!--**Question:** What do I need to do after editing these files to have a Nginx configuration changes take effect? -->
-<!-- When you write : "if your environment has no configured applications." Do we need the word "configured"? When does my environment have non-configured applications in it? Is the distinction required? -->
+<h2 id="topic2"> Apply Nginx customizations to your environment</h2>
+After you edit customizable files, make sure to reload Ngnix in your environment so that your customizations take effect.
-<!--**Question:** What do I need to do after editing these files to have a Nginx configuration changes take effect? -->
+###To apply your Nginx customizations to your environment
-<h2 id="topic1"> Apply Nginx customizations to new or rebuilt instances</h2>
+1. Via SSH connect to the application master instance and edit one or more of the files listed [above][1].
-**Important!** Because these files are not managed by Chef, if you rebuild your environment or add an application instance from a fresh data volume, your Nginx customizations are lost.
+2. Load new the Ngnix configuration files by doing one of the following:
+ * In the UI, click Apply.
+ * Via SSH connect to the application master instance and type this engineyard gem command:
-<!-- Is this about new instances to an existing environment or creating a new environment? -->
+ ey ssh "sudo /etc/init.d/nginx reload" -e environment_name --app-servers
-<!-- what are the steps for creating a data volume from a previous snapshot? -->
-###To apply your Nginx customizations to a new or rebuilt instance
+<h2 id="topic3"> Apply Nginx customizations to other environments or instances</h2>
-1. If you don't take a recent snapshot available, take a snapshot of the environment.
-
-<!-- I snapshot a whole environment, right? Not just an instance? -->
+Use a recent snapshot to copy your Nginx customizations from one environment or application instance to another.
-<!-- Then I can clone the environment. If I have a cluster, I can add an instance like app or database slave that is based on a snapshot... is Nginx on DB instances or only app instances. -->
+**Important!** Because [these customizable files][1] are not managed by Chef, if you rebuild your environment or add an application instance from a fresh data volume (instead of a snapshot), your Nginx customizations are lost.
+###To apply your Nginx customizations to another environment or instance
+
+1. If you don't take a recent snapshot available, take a snapshot of the environment.
+2. If you are creating an environment, clone the environment from the already customized environment.
+
+ or
+
+ If you are rebuilding the environment or adding an application slave to the existing environment, use the recent snapshot when rebuilding.
+
+<h2 id="topic5"> More information</h2>
+
+<table>
+ <tr>
+ <th>For more information about...</th><th>See...</th>
+ </tr>
+ <tr>
+ <td>SSHing into an instance</td><td>[[Connect to your instance via SSH|ssh-connect]].</td>
+ </tr>
+ <tr>
+ <td>the engineyard gem</td><td>[[Engine Yard CLI User Guide|ey_cli_user_guide]].</td>
+ </tr>
+<tr>
+ <td>adding an instance to a cluster</td><td>[[Clustered environments|environment-cluster]].</td>
+ </tr>
+ <tr>
+ <td>cloning an environment</td><td>[[Clone an environment|environment-clone]].</td>
+ </tr>
+</table>
[1]: #topic1 "topic1"
View
2  pages/instance-intro.md
@@ -48,7 +48,7 @@ both of these volumes from previous snapshots.
<th>For more information about...</th><th>See...</th>
</tr>
<tr>
- <td>adding an instance to a cluster</td><td>[[Clustered Environments|environment-cluster]]</td>
+ <td>adding an instance to a cluster</td><td>[[Clustered environments|environment-cluster]]</td>
</tr>
</table>
Please sign in to comment.
Something went wrong with that request. Please try again.