| 25 | W pierwszym kroku należy pobrać następujące składniki: |
| 26 | * Nginx dla Windows [http://nginx.org/download/nginx-1.7.6.zip http://nginx.org/download/nginx-1.7.6.zip] |
| 27 | * PHP w wersji 5.4 NTS [http://windows.php.net/downloads/releases/php-5.4.33-nts-Win32-VC9-x86.zip http://windows.php.net/downloads/releases/php-5.4.33-nts-Win32-VC9-x86.zip] |
| 28 | * Zend Guard Loader [http://www.zend.com/en/products/guard/downloads#Windows http://www.zend.com/en/products/guard/downloads#Windows] |
| 29 | |
| 30 | Po pobraniu należy rozpakować archiwa. Sugerowane katalogi, to dla Nginx C:\nginx, php C:\php. Zend Guard Loader-a możne wkopiować do katalogu PHP (odniesienie do konfiguracji jest w php.ini). |
| 31 | |
| 32 | Przykładowa konfiguracja Nginks-a jest zawarta w pliku {{{<Dysk instalacji>:\nginx\conf\nginx.conf}}}. Zakłada ona, że katalogiem instalacji systemu eDokumenty jest katalog: |
| 33 | {{{D:\eDokumenty\public_html}}} |
| 34 | |
| 35 | {{{ |
| 36 | |
| 37 | #user nobody; |
| 38 | worker_processes 1; |
| 39 | |
| 40 | #error_log logs/error.log; |
| 41 | #error_log logs/error.log notice; |
| 42 | #error_log logs/error.log info; |
| 43 | |
| 44 | #pid logs/nginx.pid; |
| 45 | |
| 46 | |
| 47 | events { |
| 48 | worker_connections 1024; |
| 49 | } |
| 50 | |
| 51 | |
| 52 | http { |
| 53 | include mime.types; |
| 54 | default_type application/octet-stream; |
| 55 | |
| 56 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
| 57 | # '$status $body_bytes_sent "$http_referer" ' |
| 58 | # '"$http_user_agent" "$http_x_forwarded_for"'; |
| 59 | |
| 60 | #access_log logs/access.log main; |
| 61 | |
| 62 | sendfile on; |
| 63 | #tcp_nopush on; |
| 64 | |
| 65 | #keepalive_timeout 0; |
| 66 | keepalive_timeout 65; |
| 67 | |
| 68 | #gzip on; |
| 69 | |
| 70 | server { |
| 71 | listen 8080; |
| 72 | server_name localhost; |
| 73 | |
| 74 | #charset koi8-r; |
| 75 | |
| 76 | #access_log logs/host.access.log main; |
| 77 | |
| 78 | location / { |
| 79 | root "D:/eDokumenty/public_html/"; |
| 80 | index index.html index.htm index.php engine engine.php; |
| 81 | |
| 82 | } |
| 83 | |
| 84 | #error_page 404 /404.html; |
| 85 | |
| 86 | # redirect server error pages to the static page /50x.html |
| 87 | # |
| 88 | error_page 500 502 503 504 /50x.html; |
| 89 | location = /50x.html { |
| 90 | root html; |
| 91 | } |
| 92 | |
| 93 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 |
| 94 | # |
| 95 | #location ~ \.php$ { |
| 96 | # proxy_pass http://127.0.0.1; |
| 97 | #} |
| 98 | |
| 99 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
| 100 | # |
| 101 | |
| 102 | |
| 103 | location ~ \.php($|/) { |
| 104 | |
| 105 | # root html; |
| 106 | include fastcgi_params; |
| 107 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; |
| 108 | fastcgi_pass 127.0.0.1:9000; |
| 109 | # fastcgi_index engine.php; |
| 110 | fastcgi_index index.php; |
| 111 | fastcgi_param SCRIPT_FILENAME D:/eDokumenty/public_html/$fastcgi_script_name; |
| 112 | fastcgi_param PATH_INFO $fastcgi_path_info; |
| 113 | include fastcgi_params; |
| 114 | } |
| 115 | |
| 116 | location ~ engine { |
| 117 | include fastcgi_params; |
| 118 | fastcgi_split_path_info ^(.+engine)(/.*)$; |
| 119 | fastcgi_index engine; |
| 120 | fastcgi_param SCRIPT_FILENAME D:/eDokumenty/public_html/$fastcgi_script_name; |
| 121 | fastcgi_pass 127.0.0.1:9000; |
| 122 | } |
| 123 | |
| 124 | |
| 125 | |
| 126 | # deny access to .htaccess files, if Apache's document root |
| 127 | # concurs with nginx's one |
| 128 | # |
| 129 | #location ~ /\.ht { |
| 130 | # deny all; |
| 131 | #} |
| 132 | } |
| 133 | |
| 134 | |
| 135 | # another virtual host using mix of IP-, name-, and port-based configuration |
| 136 | # |
| 137 | #server { |
| 138 | # listen 8000; |
| 139 | # listen somename:8080; |
| 140 | # server_name somename alias another.alias; |
| 141 | |
| 142 | # location / { |
| 143 | # root html; |
| 144 | # index index.html index.htm; |
| 145 | # } |
| 146 | #} |
| 147 | |
| 148 | |
| 149 | # HTTPS server |
| 150 | # |
| 151 | #server { |
| 152 | # listen 443 ssl; |
| 153 | # server_name localhost; |
| 154 | |
| 155 | # ssl_certificate cert.pem; |
| 156 | # ssl_certificate_key cert.key; |
| 157 | |
| 158 | # ssl_session_cache shared:SSL:1m; |
| 159 | # ssl_session_timeout 5m; |
| 160 | |
| 161 | # ssl_ciphers HIGH:!aNULL:!MD5; |
| 162 | # ssl_prefer_server_ciphers on; |
| 163 | |
| 164 | # location / { |
| 165 | # root html; |
| 166 | # index index.html index.htm; |
| 167 | # } |
| 168 | #} |
| 169 | |
| 170 | } |
| 171 | |
| 172 | |
| 173 | }}} |
| 174 | |