4 <title>CodeMirror: NGINX mode</title>
5 <link rel="stylesheet" href="../../lib/codemirror.css">
6 <script src="../../lib/codemirror.js"></script>
7 <script src="nginx.js"></script>
8 <style>.CodeMirror {background: #f8f8f8;}</style>
9 <link rel="stylesheet" href="../../doc/docs.css">
17 .CodeMirror, .CodeMirror-scroll {
23 <h1>CodeMirror: NGINX mode</h1>
24 <form><textarea id="code" name="code" style="height: 800px;">
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
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
39 listen 173.255.219.235:80;
40 server_name www.website.com.au;
45 index index.html index.php;
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
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; }
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
68 location /. { ## Disable .htaccess and other hidden files
72 location @handler { ## Magento uses a common front handler
76 location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
77 rewrite ^/(.*.php)/ /$1 last;
81 if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
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;
95 listen 173.255.219.235:443;
96 server_name website.com.au www.website.com.au;
99 index index.html index.php;
102 ssl_certificate /rs/ssl/ssl.crt;
103 ssl_certificate_key /rs/ssl/ssl.key;
105 ssl_session_timeout 5m;
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;
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
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; }
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
134 location /. { ## Disable .htaccess and other hidden files
138 location @handler { ## Magento uses a common front handler
139 rewrite / /index.php;
142 location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
143 rewrite ^/(.*.php)/ /$1 last;
146 location ~ .php$ { ## Execute PHP scripts
147 if (!-e $request_filename) { rewrite /index.php last; } ## Catch 404s that try_files miss
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;
155 fastcgi_param HTTPS on;
161 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
164 <p><strong>MIME types defined:</strong> <code>text/nginx</code>.</p>