<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nginx on Hw5e&#39;s Page</title>
    <link>https://page.hw5e.cc/tags/nginx/</link>
    <description>Recent content in Nginx on Hw5e&#39;s Page</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>ko</language>
    <managingEditor>hnw1155c@gmail.com (hw5e)</managingEditor>
    <webMaster>hnw1155c@gmail.com (hw5e)</webMaster>
    <copyright>© 2025 hw5e</copyright>
    <lastBuildDate>Fri, 31 Jan 2025 20:11:00 +0900</lastBuildDate><atom:link href="https://page.hw5e.cc/tags/nginx/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Nginx 로그 관련 메모</title>
      <link>https://page.hw5e.cc/memo/2025q1/nginxlog/</link>
      <pubDate>Fri, 31 Jan 2025 20:11:00 +0900</pubDate>
      <author>hnw1155c@gmail.com (hw5e)</author>
      <guid>https://page.hw5e.cc/memo/2025q1/nginxlog/</guid>
      <description>&lt;h2 class=&#34;relative group&#34;&gt;로그를 관리하는 logrotate 
    &lt;div id=&#34;%EB%A1%9C%EA%B7%B8%EB%A5%BC-%EA%B4%80%EB%A6%AC%ED%95%98%EB%8A%94-logrotate&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
    
    &lt;span
        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
        &lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
            style=&#34;text-decoration-line: none !important;&#34; href=&#34;#%EB%A1%9C%EA%B7%B8%EB%A5%BC-%EA%B4%80%EB%A6%AC%ED%95%98%EB%8A%94-logrotate&#34; aria-label=&#34;앵커&#34;&gt;#&lt;/a&gt;
    &lt;/span&gt;        
    
&lt;/h2&gt;
&lt;p&gt;로그를 얼마나 남길지, 어떻게 파일을 분리할지, 압축할지를 설정 가능한 것 같다.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Nginx의 server_name, default_server (IP주소로 접속하는 것 막기, 포트 하나로 여러 개의 사이트 띄우기)</title>
      <link>https://page.hw5e.cc/post/2025/nginx-svrname/</link>
      <pubDate>Sun, 19 Jan 2025 08:58:41 +0900</pubDate>
      <author>hnw1155c@gmail.com (hw5e)</author>
      <guid>https://page.hw5e.cc/post/2025/nginx-svrname/</guid>
      <description>&lt;h2 class=&#34;relative group&#34;&gt;server_name의 역할 
    &lt;div id=&#34;server_name%EC%9D%98-%EC%97%AD%ED%95%A0&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
    
    &lt;span
        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
        &lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
            style=&#34;text-decoration-line: none !important;&#34; href=&#34;#server_name%EC%9D%98-%EC%97%AD%ED%95%A0&#34; aria-label=&#34;앵커&#34;&gt;#&lt;/a&gt;
    &lt;/span&gt;        
    
&lt;/h2&gt;
&lt;p&gt;nginx는 같은 포트를 listen하는 여러 개의 사이트를 있게 할 수 있는데,&lt;br&gt;
여기서 &lt;code&gt;server_name&lt;/code&gt;은 하나의 포트를 listen 하고 있는 여러 개의 사이트가 있을 때 어느 쪽을 사용할지 결정해주는 역할을 한다.&lt;br&gt;
만약 &lt;code&gt;server_name&lt;/code&gt;에 일치하는 것이 없다면 &lt;code&gt;default_server&lt;/code&gt;가 있는 것이 우선적으로 사용되고 &lt;code&gt;default_server&lt;/code&gt; 붙은 것이 없다면 먼저 선언한 것이 우선한다.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Nginx Stream 프록시</title>
      <link>https://page.hw5e.cc/memo/2025q1/nginx-stream/</link>
      <pubDate>Mon, 13 Jan 2025 16:36:23 +0900</pubDate>
      <author>hnw1155c@gmail.com (hw5e)</author>
      <guid>https://page.hw5e.cc/memo/2025q1/nginx-stream/</guid>
      <description>&lt;p&gt;nginx는 http이외의 TCP나 UDP 프록시도 지원하는데 그러려면 http블록 밖의 stream 블록에서 선언해야 한다.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>서버 프로그램과 PHP의 통신</title>
      <link>https://page.hw5e.cc/memo/2024q4/svr-php/</link>
      <pubDate>Tue, 10 Dec 2024 06:06:16 +0900</pubDate>
      <author>hnw1155c@gmail.com (hw5e)</author>
      <guid>https://page.hw5e.cc/memo/2024q4/svr-php/</guid>
      <description>&lt;p&gt;서버 프로그램이 PHP를 사용하려면 fastcgi를 쓰는것 같은데 그건 제껴두고 리눅스 시스템에서 php가 서버와 통신하는데 두가지 방식이 있는 것 같은데
하나는 유닉스 소켓을 이용 TCP/IP를 이용한다.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>CORS 문제로 작동하지 않은 hugo 검색 기능</title>
      <link>https://page.hw5e.cc/post/2024/cors_hugo/</link>
      <pubDate>Sun, 01 Dec 2024 08:32:33 +0900</pubDate>
      <author>hnw1155c@gmail.com (hw5e)</author>
      <guid>https://page.hw5e.cc/post/2024/cors_hugo/</guid>
      <description>&lt;h2 class=&#34;relative group&#34;&gt;문제 상황 
    &lt;div id=&#34;%EB%AC%B8%EC%A0%9C-%EC%83%81%ED%99%A9&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
    
    &lt;span
        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
        &lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
            style=&#34;text-decoration-line: none !important;&#34; href=&#34;#%EB%AC%B8%EC%A0%9C-%EC%83%81%ED%99%A9&#34; aria-label=&#34;앵커&#34;&gt;#&lt;/a&gt;
    &lt;/span&gt;        
    
&lt;/h2&gt;
&lt;p&gt;갑자기 이 사이트의 검색 기능이 작동하지 않는 것을 발견했는데 이상하게 다른 컴퓨터에서 열어봤을 때는 검색 기능이 작동했다. 대충 검색하다 개발자 도구를 열어봤더니 CORS 정책 때문에 index.json을 열 수 없다는 내용이였다.

    &lt;figure&gt;
      &lt;img
        class=&#34;my-0 rounded-md&#34;
        loading=&#34;lazy&#34;
        srcset=&#34;
        /post/2024/cors_hugo/featured_hu11613662072047376899.png 330w,
        /post/2024/cors_hugo/featured_hu3469156087312119459.png 660w,
        /post/2024/cors_hugo/featured_hu8141731089786230745.png 1024w,
        /post/2024/cors_hugo/featured_hu17459195717488181828.png 2x&#34;
        src=&#34;https://page.hw5e.cc/post/2024/cors_hugo/featured_hu3469156087312119459.png&#34;
        alt=&#34;&#34;
      /&gt;
      
    &lt;/figure&gt;

자세히보니 검색할 때 page.hw5e.cc/index.json을 가져오는데 &lt;a href=&#34;https://www.page.hw5e.cc&#34; target=&#34;_blank&#34;&gt;https://www.page.hw5e.cc&lt;/a&gt; 에서 &lt;a href=&#34;https://page.hw5e.cc&#34; target=&#34;_blank&#34;&gt;https://page.hw5e.cc&lt;/a&gt;에 있는 index.json을 가져올 수 없어서 검색이 되지 않았던 것이다.&lt;br&gt;
다시 확인해 보니 page.hw5e.cc에서는 검색이 되고 &lt;a href=&#34;https://www.page.hw5e.cc&#34; target=&#34;_blank&#34;&gt;www.page.hw5e.cc&lt;/a&gt;로 접속하면 검색이 안되는 것을 확인했다.&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://page.hw5e.cc/post/2024/cors_hugo/featured.png" />
    </item>
    
    <item>
      <title>Nginx 소스로 부터 빌드하기</title>
      <link>https://page.hw5e.cc/post/2024/build-nginx/</link>
      <pubDate>Sat, 23 Nov 2024 04:58:49 +0900</pubDate>
      <author>hnw1155c@gmail.com (hw5e)</author>
      <guid>https://page.hw5e.cc/post/2024/build-nginx/</guid>
      <description>&lt;p&gt;보통 패키지 관리자를 통해 설치하겠지만 경우에 따라서 nginx를 직접 빌드 해야할 때가 있다.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
