|
8 | 8 | <style>.CodeMirror {background: #f8f8f8;}</style> |
9 | 9 | <link rel="stylesheet" href="../../doc/docs.css"> |
10 | 10 | </head> |
11 | | - |
| 11 | + |
12 | 12 | <style> |
13 | 13 | body { |
14 | 14 | margin: 0em auto; |
15 | 15 | } |
16 | | - |
| 16 | + |
17 | 17 | .CodeMirror, .CodeMirror-scroll { |
18 | 18 | height: 600px; |
19 | 19 | } |
20 | 20 | </style> |
21 | | - |
| 21 | + |
22 | 22 | <body> |
23 | 23 | <h1>CodeMirror: NGINX mode</h1> |
24 | 24 | <form><textarea id="code" name="code" style="height: 800px;"> |
25 | | - server { |
26 | | - listen 173.255.219.235:80; |
27 | | - server_name website.com.au; |
28 | | - rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www |
| 25 | +server { |
| 26 | + listen 173.255.219.235:80; |
| 27 | + server_name website.com.au; |
| 28 | + rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www |
29 | 29 | } |
30 | 30 |
|
31 | 31 | server { |
32 | | - listen 173.255.219.235:443; |
33 | | - server_name website.com.au; |
34 | | - rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www |
| 32 | + listen 173.255.219.235:443; |
| 33 | + server_name website.com.au; |
| 34 | + rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www |
35 | 35 | } |
36 | 36 |
|
37 | 37 | server { |
38 | | - |
39 | | - listen 173.255.219.235:80; |
40 | | - server_name www.website.com.au; |
41 | | - |
42 | | - |
43 | | - |
44 | | - root /data/www; |
45 | | - index index.html index.php; |
46 | | - |
47 | | - location / { |
48 | | - index index.html index.php; ## Allow a static html file to be shown first |
49 | | - try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler |
50 | | - expires 30d; ## Assume all files are cachable |
51 | | - } |
52 | | - |
53 | | - ## These locations would be hidden by .htaccess normally |
54 | | - location /app/ { deny all; } |
55 | | - location /includes/ { deny all; } |
56 | | - location /lib/ { deny all; } |
57 | | - location /media/downloadable/ { deny all; } |
58 | | - location /pkginfo/ { deny all; } |
59 | | - location /report/config.xml { deny all; } |
60 | | - location /var/ { deny all; } |
61 | | - |
62 | | - location /var/export/ { ## Allow admins only to view export folder |
63 | | - auth_basic "Restricted"; ## Message shown in login window |
64 | | - auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword |
65 | | - autoindex on; |
66 | | - } |
67 | | - |
68 | | - location /. { ## Disable .htaccess and other hidden files |
69 | | - return 404; |
70 | | - } |
71 | | - |
72 | | - location @handler { ## Magento uses a common front handler |
73 | | - rewrite / /index.php; |
74 | | - } |
75 | | - |
76 | | - location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler |
77 | | - rewrite ^/(.*.php)/ /$1 last; |
78 | | - } |
79 | | - |
80 | | - location ~ \.php$ { |
81 | | - if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss |
82 | | - |
83 | | - fastcgi_pass 127.0.0.1:9000; |
84 | | - fastcgi_index index.php; |
85 | | - fastcgi_param PATH_INFO $fastcgi_script_name; |
86 | | - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
87 | | - include /rs/confs/nginx/fastcgi_params; |
88 | | - } |
89 | | - |
| 38 | + |
| 39 | + listen 173.255.219.235:80; |
| 40 | + server_name www.website.com.au; |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + root /data/www; |
| 45 | + index index.html index.php; |
| 46 | + |
| 47 | + location / { |
| 48 | + index index.html index.php; ## Allow a static html file to be shown first |
| 49 | + try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler |
| 50 | + expires 30d; ## Assume all files are cachable |
| 51 | + } |
| 52 | + |
| 53 | + ## These locations would be hidden by .htaccess normally |
| 54 | + location /app/ { deny all; } |
| 55 | + location /includes/ { deny all; } |
| 56 | + location /lib/ { deny all; } |
| 57 | + location /media/downloadable/ { deny all; } |
| 58 | + location /pkginfo/ { deny all; } |
| 59 | + location /report/config.xml { deny all; } |
| 60 | + location /var/ { deny all; } |
| 61 | + |
| 62 | + location /var/export/ { ## Allow admins only to view export folder |
| 63 | + auth_basic "Restricted"; ## Message shown in login window |
| 64 | + auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword |
| 65 | + autoindex on; |
90 | 66 | } |
91 | | - |
92 | | - |
93 | | - server { |
94 | | - |
95 | | - listen 173.255.219.235:443; |
96 | | - server_name website.com.au www.website.com.au; |
97 | | - |
98 | | - root /data/www; |
99 | | - index index.html index.php; |
100 | | - |
101 | | - ssl on; |
102 | | - ssl_certificate /rs/ssl/ssl.crt; |
103 | | - ssl_certificate_key /rs/ssl/ssl.key; |
104 | | - |
105 | | - ssl_session_timeout 5m; |
106 | | - |
107 | | - ssl_protocols SSLv2 SSLv3 TLSv1; |
108 | | - ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; |
109 | | - ssl_prefer_server_ciphers on; |
110 | | - |
111 | | - |
112 | | - |
113 | | - location / { |
114 | | - index index.html index.php; ## Allow a static html file to be shown first |
115 | | - try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler |
116 | | - expires 30d; ## Assume all files are cachable |
117 | | - } |
118 | | - |
119 | | - ## These locations would be hidden by .htaccess normally |
120 | | - location /app/ { deny all; } |
121 | | - location /includes/ { deny all; } |
122 | | - location /lib/ { deny all; } |
123 | | - location /media/downloadable/ { deny all; } |
124 | | - location /pkginfo/ { deny all; } |
125 | | - location /report/config.xml { deny all; } |
126 | | - location /var/ { deny all; } |
127 | | - |
128 | | - location /var/export/ { ## Allow admins only to view export folder |
129 | | - auth_basic "Restricted"; ## Message shown in login window |
130 | | - auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword |
131 | | - autoindex on; |
132 | | - } |
133 | | - |
134 | | - location /. { ## Disable .htaccess and other hidden files |
135 | | - return 404; |
136 | | - } |
137 | | - |
138 | | - location @handler { ## Magento uses a common front handler |
139 | | - rewrite / /index.php; |
140 | | - } |
141 | | - |
142 | | - location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler |
143 | | - rewrite ^/(.*.php)/ /$1 last; |
144 | | - } |
145 | | - |
146 | | - location ~ .php$ { ## Execute PHP scripts |
147 | | - if (!-e $request_filename) { rewrite /index.php last; } ## Catch 404s that try_files miss |
148 | | - |
149 | | - fastcgi_pass 127.0.0.1:9000; |
150 | | - fastcgi_index index.php; |
151 | | - fastcgi_param PATH_INFO $fastcgi_script_name; |
152 | | - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
153 | | - include /rs/confs/nginx/fastcgi_params; |
154 | | - |
155 | | - fastcgi_param HTTPS on; |
156 | | - } |
157 | | - |
158 | | - } |
159 | 67 |
|
| 68 | + location /. { ## Disable .htaccess and other hidden files |
| 69 | + return 404; |
| 70 | + } |
| 71 | + |
| 72 | + location @handler { ## Magento uses a common front handler |
| 73 | + rewrite / /index.php; |
| 74 | + } |
| 75 | + |
| 76 | + location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler |
| 77 | + rewrite ^/(.*.php)/ /$1 last; |
| 78 | + } |
| 79 | + |
| 80 | + location ~ \.php$ { |
| 81 | + if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss |
| 82 | + |
| 83 | + fastcgi_pass 127.0.0.1:9000; |
| 84 | + fastcgi_index index.php; |
| 85 | + fastcgi_param PATH_INFO $fastcgi_script_name; |
| 86 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 87 | + include /rs/confs/nginx/fastcgi_params; |
| 88 | + } |
| 89 | + |
| 90 | +} |
| 91 | + |
| 92 | + |
| 93 | +server { |
| 94 | + |
| 95 | + listen 173.255.219.235:443; |
| 96 | + server_name website.com.au www.website.com.au; |
| 97 | + |
| 98 | + root /data/www; |
| 99 | + index index.html index.php; |
| 100 | + |
| 101 | + ssl on; |
| 102 | + ssl_certificate /rs/ssl/ssl.crt; |
| 103 | + ssl_certificate_key /rs/ssl/ssl.key; |
| 104 | + |
| 105 | + ssl_session_timeout 5m; |
| 106 | + |
| 107 | + ssl_protocols SSLv2 SSLv3 TLSv1; |
| 108 | + ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; |
| 109 | + ssl_prefer_server_ciphers on; |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + location / { |
| 114 | + index index.html index.php; ## Allow a static html file to be shown first |
| 115 | + try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler |
| 116 | + expires 30d; ## Assume all files are cachable |
| 117 | + } |
| 118 | + |
| 119 | + ## These locations would be hidden by .htaccess normally |
| 120 | + location /app/ { deny all; } |
| 121 | + location /includes/ { deny all; } |
| 122 | + location /lib/ { deny all; } |
| 123 | + location /media/downloadable/ { deny all; } |
| 124 | + location /pkginfo/ { deny all; } |
| 125 | + location /report/config.xml { deny all; } |
| 126 | + location /var/ { deny all; } |
| 127 | + |
| 128 | + location /var/export/ { ## Allow admins only to view export folder |
| 129 | + auth_basic "Restricted"; ## Message shown in login window |
| 130 | + auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword |
| 131 | + autoindex on; |
| 132 | + } |
| 133 | + |
| 134 | + location /. { ## Disable .htaccess and other hidden files |
| 135 | + return 404; |
| 136 | + } |
| 137 | + |
| 138 | + location @handler { ## Magento uses a common front handler |
| 139 | + rewrite / /index.php; |
| 140 | + } |
| 141 | + |
| 142 | + location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler |
| 143 | + rewrite ^/(.*.php)/ /$1 last; |
| 144 | + } |
| 145 | + |
| 146 | + location ~ .php$ { ## Execute PHP scripts |
| 147 | + if (!-e $request_filename) { rewrite /index.php last; } ## Catch 404s that try_files miss |
| 148 | + |
| 149 | + fastcgi_pass 127.0.0.1:9000; |
| 150 | + fastcgi_index index.php; |
| 151 | + fastcgi_param PATH_INFO $fastcgi_script_name; |
| 152 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 153 | + include /rs/confs/nginx/fastcgi_params; |
| 154 | + |
| 155 | + fastcgi_param HTTPS on; |
| 156 | + } |
| 157 | + |
| 158 | +} |
160 | 159 | </textarea></form> |
161 | 160 | <script> |
162 | 161 | var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); |
|
0 commit comments