| 776 |
lars |
1 |
<!doctype html>
|
|
|
2 |
<title>CodeMirror: NGINX mode</title>
|
|
|
3 |
<meta charset="utf-8" />
|
|
|
4 |
<link rel=stylesheet href="../../doc/docs.css">
|
|
|
5 |
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
|
6 |
<script src="../../lib/codemirror.js"></script>
|
|
|
7 |
<script src="nginx.js"></script>
|
|
|
8 |
<style>
|
|
|
9 |
.CodeMirror {
|
|
|
10 |
background: #f8f8f8;
|
|
|
11 |
}
|
|
|
12 |
</style>
|
|
|
13 |
<link rel="stylesheet" href="../../doc/docs.css"> </head>
|
|
|
14 |
<style>
|
|
|
15 |
body {
|
|
|
16 |
margin: 0em auto;
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
.CodeMirror,
|
|
|
20 |
.CodeMirror-scroll {
|
|
|
21 |
height: 600px;
|
|
|
22 |
}
|
|
|
23 |
</style>
|
|
|
24 |
<div id=nav>
|
|
|
25 |
<a href="http://codemirror.net">
|
|
|
26 |
<h1>CodeMirror</h1>
|
|
|
27 |
<img id=logo src="../../doc/logo.png">
|
|
|
28 |
</a>
|
|
|
29 |
<ul>
|
|
|
30 |
<li>
|
|
|
31 |
<a href="../../index.html">Home</a>
|
|
|
32 |
<li>
|
|
|
33 |
<a href="../../doc/manual.html">Manual</a>
|
|
|
34 |
<li>
|
|
|
35 |
<a href="https://github.com/codemirror/codemirror">Code</a>
|
|
|
36 |
</ul>
|
|
|
37 |
<ul>
|
|
|
38 |
<li>
|
|
|
39 |
<a href="../index.html">Language modes</a>
|
|
|
40 |
<li>
|
|
|
41 |
<a class=active href="#">NGINX</a>
|
|
|
42 |
</ul>
|
|
|
43 |
</div>
|
|
|
44 |
<article>
|
|
|
45 |
<h2>NGINX mode</h2>
|
|
|
46 |
<form>
|
|
|
47 |
<textarea id="code" name="code" style="height: 800px;"> server { listen 173.255.219.235:80; server_name website.com.au; rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www } server { listen 173.255.219.235:443; server_name website.com.au; rewrite / $scheme://www.$host$request_uri
|
|
|
48 |
permanent; ## Forcibly prepend a www } server { listen 173.255.219.235:80; server_name www.website.com.au; root /data/www; index index.html index.php; location / { index index.html index.php; ## Allow a static html file to be shown first try_files
|
|
|
49 |
$uri $uri/ @handler; ## If missing pass the URI to Magento's front handler expires 30d; ## Assume all files are cachable } ## These locations would be hidden by .htaccess normally location /app/ { deny all; } location /includes/ { deny all;
|
|
|
50 |
} location /lib/ { deny all; } location /media/downloadable/ { deny all; } location /pkginfo/ { deny all; } location /report/config.xml { deny all; } location /var/ { deny all; } location /var/export/ { ## Allow admins only to view export
|
|
|
51 |
folder auth_basic "Restricted"; ## Message shown in login window auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword autoindex on; } location /. { ## Disable .htaccess and other hidden files return 404; } location @handler
|
|
|
52 |
{ ## Magento uses a common front handler rewrite / /index.php; } location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler rewrite ^/(.*.php)/ /$1 last; } location ~ \.php$ { if (!-e $request_filename) { rewrite / /index.php
|
|
|
53 |
last; } ## Catch 404s that try_files miss fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /rs/confs/nginx/fastcgi_params;
|
|
|
54 |
} } server { listen 173.255.219.235:443; server_name website.com.au www.website.com.au; root /data/www; index index.html index.php; ssl on; ssl_certificate /rs/ssl/ssl.crt; ssl_certificate_key /rs/ssl/ssl.key; ssl_session_timeout 5m; ssl_protocols
|
|
|
55 |
SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; location / { index index.html index.php; ## Allow a static html file to be shown first try_files $uri $uri/ @handler; ##
|
|
|
56 |
If missing pass the URI to Magento's front handler expires 30d; ## Assume all files are cachable } ## These locations would be hidden by .htaccess normally location /app/ { deny all; } location /includes/ { deny all; } location /lib/ { deny
|
|
|
57 |
all; } location /media/downloadable/ { deny all; } location /pkginfo/ { deny all; } location /report/config.xml { deny all; } location /var/ { deny all; } location /var/export/ { ## Allow admins only to view export folder auth_basic "Restricted";
|
|
|
58 |
## Message shown in login window auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword autoindex on; } location /. { ## Disable .htaccess and other hidden files return 404; } location @handler { ## Magento uses a common front handler
|
|
|
59 |
rewrite / /index.php; } location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler rewrite ^/(.*.php)/ /$1 last; } location ~ .php$ { ## Execute PHP scripts if (!-e $request_filename) { rewrite /index.php last; } ## Catch
|
|
|
60 |
404s that try_files miss fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /rs/confs/nginx/fastcgi_params; fastcgi_param
|
|
|
61 |
HTTPS on; } } </textarea>
|
|
|
62 |
</form>
|
|
|
63 |
<script>
|
|
|
64 |
var editor = CodeMirror.fromTextArea(document.getElementById("code"),
|
|
|
65 |
{});
|
|
|
66 |
</script>
|
|
|
67 |
<p>
|
|
|
68 |
<strong>MIME types defined:</strong> <code>text/nginx</code>.</p>
|
|
|
69 |
</article>
|