Archive for the ‘nginx’ Category

 

Comodo PositiveSSL のインストール、中間証明書とか

10月 25th, 2016

無事、証明書が送られてきたので 以下の4つ、自信の証明書と3つの中間証明書 aucru_com.crt COMODORSADomainValidationSecureServerCA.crt AddTrustExternalCARoot.crt COMODORSAAddTrustCA.crt nginx は、これらの中身を一つの crtに連結して設定するだけです。 keyはopensslで作成したもの。 ssl_certificate /myhome../ssl.crt; ssl_certificate_key /myhome…/ssl.key; 以上でした。暗号化利用だけなので それなりに使われているものが 3年15ドルは安くて良いですね^^

Read full article | コメントは受け付けていません。

SSL : rapid sslを更新する

8月 26th, 2015

というかもうすぐ期限切れなので ssls.comで取り直し CSR作成 https://www.geotrust.co.jp/support/ssl/csr/apache_openssl_new.html RapidSSL 9.95$ をpaypalで購入 . activate へ CSRを貼付けて次へ . 認証用のファイル xxxx.htmをダウンロードして該当ドメインのrootに置く . 承認は手動なので10分以上かかることがあるそうです。 . メール内のリンクから、geotrustの状況も確認可能(order状態であることを確認 2営業日何も無かったので、メールしてみた。 ssls.comのサポートメールに idとか書いて、uploadしたから見て!と 1時間以内に返信が来て登録完了で geotrust.comよりメールが来ました。 RapidSSL nginx設定。 ssl.crtとintermediate.crtをくっつけるくらいで https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO17664 keyの PEM passphraseを削除 openssl rsa -in /etc/ssl/private/example.key -out /etc/ssl/private/example.nocrypt.key でOKでした! RapidSSL 256CA – G3 で。 https://aucru.com 9.95$で問題なく設定完了です。普通のサイトはこれで問題ないですね ecとかはもう一つ上の認証が良いですが。

Read full article | コメントは受け付けていません。

nginx ssl v3を無効化 poodle対策

11月 21st, 2014

http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_protocols Syntax: ssl_protocols [SSLv2] [SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2]; Default: ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; Context: http, server なので ssl_protocolsを指定します。SSLv3を抜いて。 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; とします。 で再起動。

Read full article | コメントは受け付けていません。

nginx subdir basic auth + php-fpm fastcgi

5月 26th, 2014

その場に書いたり locationの中にlocationを描いてその中にfastcgiと書く方法は利用出来ませんでした。 http://stackoverflow.com/questions/16779131/nginx-basic-auth-and-subfolders こちらのように一旦try_filesでパラメーターを設定する方法で上手く行きました。 こんな感じで user 以下にはbasic 認証が反映されました。 location ~ ^/user/* { auth_basic “user area”; auth_basic_user_file /home/appname/app/conf/httpd/passwd; try_files $uri @rewriteapp; } location / { index index.php index.html; try_files $uri @rewriteapp; } location @rewriteapp{ rewrite ^/.*$ /index.php last; } location /index.php { fastcgi_pass unix:/var/run/php-fpm/www.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/appiine/web$fastcgi_script_name; include fastcgi_params; }

Read full article | コメントは受け付けていません。

nginx Server , X-Powered-Byを返さない。

2月 5th, 2014

Server: nginx/1.2.9 X-Powered-By: PHP/5.4.x みたいなヘッダーを返すときは server_tokens off; #proxy_hide_header X-Powered-By; more_clear_headers ‘X-Powered-By'; で返さなくなります。 php.ini expose_php = Off をしていない場合はお忘れなく。

Read full article | コメントは受け付けていません。

nginx upstream keepalive

2月 1st, 2014

upstream quadrangular { sticky name=rid path=/ expires=24h; server 000.142:30301; server 000.29:30301; keepalive 32; } こうなってるとき http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive 全部の合計ではなくて一台毎の数なので、workerが裁ける数に抑えないさいと。 メモリー1G使える場合 16M/processで利用する場合 php-fpmの設定をstaticでmax 64にしたら keepalive 64にする感じで。 1処理100msecで何かしても 128*10, 1280qps行けるので。安いVPSでもかなり使えます。

Read full article | コメントは受け付けていません。

nginx sticky

1月 31st, 2014

* 1.5.7から標準で入っている物と少し違います。 https://code.google.com/p/nginx-sticky-module/wiki/Documentation sticky [name=route] [domain=.foo.bar] [path=/] [expires=1h] [hash=index|md5|sha1] [no_fallback]; pathが別々に設定されていたのですべて共通でいいので sticky name=srd_id path=/ expires=24h; な感じに変更 問題なく振り分けられました。

Read full article | コメントは受け付けていません。

nginx 1.2.9 sticky module

1月 31st, 2014

http://blog.bbtune.com/archives/2412/nginx-exchange-header 前回 1.2.7で使っていたので sticky も追加して1.2.9で作り直す。 やり方は前回と同じ。 # nginx.spec Version: 1.2.9 に変更 SOURCE以下に 1.2.9.tar.gzを配置 https://code.google.com/p/nginx-sticky-module/downloads/list から 1.1をダウンロードして展開 # nginx.spec –add-module=/path/to/headers-more-nginx-module-0.25 \ –add-module=/path/to/nginx-sticky-module-1.1 \ # デバッグ用も作るので2カ所 を追加 で、 rpmbuild -bb nginx.spec 書き込み完了: /root/rpmbuild/RPMS/x86_64/nginx-1.2.9-1.el6.ngx.x86_64.rpm 書き込み完了: /root/rpmbuild/RPMS/x86_64/nginx-debug-1.2.9-1.el6.ngx.x86_64.rpm 書き込み完了: /root/rpmbuild/RPMS/x86_64/nginx-debuginfo-1.2.9-1.el6.ngx.x86_64.rpm #### OKなので新しく入れ替えて uptreamで * stickyで振り分け * バックエンドへのkeepalive を確認

Read full article | コメントは受け付けていません。

nginx get parameterをrewrite

10月 28th, 2013

location ~ ^/search { # http://sample.com/search_sp?search=iphone5s rewrite ^/search_sp(.*) /bid/$arg_search permanent; } これです。パラメータはarg_{key}で取れるという。凄い機能でした。 $argだと全部ついてくるようです。

Read full article | コメントは受け付けていません。

nginx x fastcgi 504 Gateway timeout

10月 12th, 2013

nginx と php-fpmで504が出た時。 php.ini max_execution_time = 60 php-fpm request_terminate_timeout 0 nginx fastcgi_read_timeout 60s んーデフォルト60秒らしいけど、60sも経ってるかな?一応

Read full article | コメントは受け付けていません。