<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://shiyoka.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://shiyoka.com/feed.php">
        <title>ClownWiki - nginx</title>
        <description></description>
        <link>https://shiyoka.com/</link>
        <image rdf:resource="https://shiyoka.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-08T13:25:12+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:cache&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:client_max_body_size&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:fastcgi&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:for_php_fpm&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:htaccess&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:install_centos6&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:php_fpm&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:proxy&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:proxy_ram&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:redmine&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:roundrobin&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:virtual.conf&amp;rev=1739713984&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=nginx:x-forwarded-for&amp;rev=1739713984&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://shiyoka.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>ClownWiki</title>
        <link>https://shiyoka.com/</link>
        <url>https://shiyoka.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:cache&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>cache</title>
        <link>https://shiyoka.com/doku.php?id=nginx:cache&amp;rev=1739713984&amp;do=diff</link>
        <description>nginxのキャッシュの種類

ブラウザキャッシュ

ブラウザキャッシュ（ローカルキャッシュ）。
キャッシュ期間以内にオリジナルが更新されていればステータスコード200で
再取得、更新されていなければステータスコード304で再取得しない。</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:client_max_body_size&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>client_max_body_size</title>
        <link>https://shiyoka.com/doku.php?id=nginx:client_max_body_size&amp;rev=1739713984&amp;do=diff</link>
        <description>ファイルのアップロードでエラー

nginxで構築しているwebサイトでファイルをアップロードしようとするとhttpエラーが発生、ログに以下のようなエラーが記録される。


client intended to send too large body: 2489522 bytes</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:fastcgi&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fastcgi</title>
        <link>https://shiyoka.com/doku.php?id=nginx:fastcgi&amp;rev=1739713984&amp;do=diff</link>
        <description>FastCGIキャッシュの設定例


# vi /etc/nginx/conf.d/default.conf 



# levels=1:2
# キャッシュパスの配下のサブディレクトリの文字数を１階層目は１文字、２階層目は２文字で設定

# keys_zone=cache_fastcgi:30m
# キャッシュパスのゾーン名、ゾーンサイズを設定

# max_size=512M
# キャッシュのファイルサイズの最大値を設定

# inactive=600m
# TTL
fastcgi_cache_path /var/cache/nginx/fastcgi_cache levels=1:2 keys_zone=cache_fastcgi:30m max_size=512M inactive=600m;
fastcgi_ignore_headers &quot;Vary&quot;;

server {
    listen 80;
    server_name 0.0.0.0;

    charset UTF-8;
    client_max_body_size 16M;
    root  /us…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:for_php_fpm&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>for_php_fpm</title>
        <link>https://shiyoka.com/doku.php?id=nginx:for_php_fpm&amp;rev=1739713984&amp;do=diff</link>
        <description>PHP-FPMと構築した場合の設定

ドキュメントルート配下にphpファイルを設置


# vi /usr/share/nginx/html/index.php

&lt;?php
phpinfo();


⇒以下の設定が必要（基本設定）


# diff /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.org
30,36c30,36
&lt;     location ~ \.php$ {
&lt;         root           /usr/share/nginx/html; ## ドキュメントルートの定義
&lt;         fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock; ## php-fpmとソケットで通信
&lt;         fastcgi_index  index.php;
&lt;         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
&lt;         in…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:htaccess&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>htaccess</title>
        <link>https://shiyoka.com/doku.php?id=nginx:htaccess&amp;rev=1739713984&amp;do=diff</link>
        <description>.htaccess

htaccess to nginx converter
&lt;http://winginx.com/ja/htaccess&gt;</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:install_centos6&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>install_centos6</title>
        <link>https://shiyoka.com/doku.php?id=nginx:install_centos6&amp;rev=1739713984&amp;do=diff</link>
        <description>CentOS6.xにnginxをインストール

nginx公式ページでyumリポジトリのURLを確認

公式：&lt;http://nginx.org/&gt;

download - Pre-Built Packages と辿る。
&lt;http://nginx.org/en/linux_packages.html#stable&gt;

RHEL や CentOS のリンクがあるので、CentOS6のURLを確認する。
&lt;http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm&gt;

リポジトリ登録</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:php_fpm&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>php_fpm</title>
        <link>https://shiyoka.com/doku.php?id=nginx:php_fpm&amp;rev=1739713984&amp;do=diff</link>
        <description>PHP-FPMとソケット通信

以下、CentOS 6.xで構築。


# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

# yum --enablerepo=remi-php56 install php php-fpm

# cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.org
# diff /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.org
23c23
&lt; user = nginx
---
&gt; user = apache
25c25
&lt; group = nginx
---
&gt; group = apache
39,40c39
&lt; ;listen = 127.0.0.1:9000
&lt; listen = /var/run/php-fpm/php-fpm.sock
---
&gt; listen = 127.0.0.1:9000
50,52c4…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:proxy&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>proxy</title>
        <link>https://shiyoka.com/doku.php?id=nginx:proxy&amp;rev=1739713984&amp;do=diff</link>
        <description>プロキシキャッシュの設定例


# vi /etc/nginx/conf.d/default.conf 



# メモリ128MB、ファイル最大480MB、7日間アクセスが無ければ削除
proxy_cache_path /var/cache/nginx/static_file_cache levels=1:2 keys_zone=cache_static_file:128m inactive=7d max_size=480m;
proxy_temp_path /var/cache/nginx/temp;
 
upstream backend {
    server 127.0.0.1:8080;
}
 
server {
    listen 80;
    server_name  0.0.0.0;
    
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:proxy_ram&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>proxy_ram</title>
        <link>https://shiyoka.com/doku.php?id=nginx:proxy_ram&amp;rev=1739713984&amp;do=diff</link>
        <description>プロキシキャッシュをramへ


http {
    ~
    proxy_cache_path /var/cache/nginx/static_file_cache levels=1:2 keys_zone=cache_static_file:128m inactive=7d max_size=480m;
    proxy_temp_path /var/cache/nginx/temp;
    ~
}



server {
    ~
    location / {
        ~
        # cache start
        proxy_cache cache_static_file;
        proxy_cache_valid 200 2h;
        proxy_cache_valid any 1m;
        # cache end
        ~
    }
    ~
}</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:redmine&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>redmine</title>
        <link>https://shiyoka.com/doku.php?id=nginx:redmine&amp;rev=1739713984&amp;do=diff</link>
        <description>参考：
	http://blog.redmine.jp/articles/redmine-1_0-installation_centos/
	http://d.hatena.ne.jp/inomas/20101209/1291826799
	http://www.02.246.ne.jp/~torutk/swetools/redmine/setupCentOS5.html
	http://vor-net.com/2010/07/centos-5-5-redmine/
	
	● ダウンロード＆インストール
	# wget http://rubyforge.org/frs/download.php/73900/redmine-1.1.0.tar.gz
	# tar zxvf redmine-1.1.0.tar.gz 
	# mv redmine-1.1.0 /var/lib/redmine
	
	● DB設定ファイル作成
	# vi /var/lib/redmine/config/database.yml
	
		production:
		adapter: mysql
		databas…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:roundrobin&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>roundrobin</title>
        <link>https://shiyoka.com/doku.php?id=nginx:roundrobin&amp;rev=1739713984&amp;do=diff</link>
        <description>リクエストを複数バックエンドに分散


# vi /etc/nginx/conf.d/default.conf



upstream backend {
    server 192.168.1.2:8080;
    server 192.168.1.3:8080;
}

server {
    listen 80;
    server_name  0.0.0.0;
    
    location / {
        proxy_pass http://backend;
    }
}</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:virtual.conf&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>virtual.conf</title>
        <link>https://shiyoka.com/doku.php?id=nginx:virtual.conf&amp;rev=1739713984&amp;do=diff</link>
        <description>#
# A virtual host using mix of IP-, name-, and port-based configuration
#

server {
   listen       80;
   server_name  sakura.niji-net.com;

   location / {
       root   /var/www/vhosts/sakura.niji-net.com;
       index  index.html index.htm index.php;
   }

   location ~ .php$ {
       root           /var/www/vhosts/sakura.niji-net.com;
       fastcgi_pass   127.0.0.1:9000;
       fastcgi_index  index.php;
       fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
       incl…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=nginx:x-forwarded-for&amp;rev=1739713984&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>x-forwarded-for</title>
        <link>https://shiyoka.com/doku.php?id=nginx:x-forwarded-for&amp;rev=1739713984&amp;do=diff</link>
        <description>LB・Proxy経由アクセスのClientIP取得

LBやProxy経由のアクセスのログをそのまま取得すると、アクセス元IPアドレスが
すべてLBやProxyのIPアドレスになる。
こういった場合は、X-Forwarded-Forから本当のアクセス元（クライアント）の
IPアドレスを取得する。</description>
    </item>
</rdf:RDF>
