<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[nginx conf - sample]]></title><description><![CDATA[<pre><code>upstream _backend {
  server 127.0.0.1:81;
}

server {
  client_max_body_size 100M;
  listen 80 default_server;
  server_name domain.com;
  client_max_body_size 100M;
  error_log  /var/log/nginx/domain.com-error.log;
  access_log /var/log/nginx/domain.com-access.log;

  if ($http_user_agent ~* "curl|wget|SemrushBot|Semrush|AhrefsBot|MJ12bot|YandexBot|YandexImages|MegaIndex.ru|BLEXbot|BLEXBot|ZoominfoBot|YaK|VelenPublicWebCrawler|SentiBot|Vagabondo|SEOkicks|SEOkicks-Robot|mtbot/1.1.0i|SeznamBot|DotBot|Cliqzbot|coccocbot|python|Scrap|SiteCheck-sitecrawl|MauiBot|Java|GumGum|Clickagy|AspiegelBot|Yandex|TkBot|CCBot|Qwantify|MBCrawler|serpstatbot|AwarioSmartBot|Semantici|ScholarBot|proximic|MojeekBot|GrapeshotCrawler|IAScrawler|linkdexbot|contxbot|PlurkBot|PaperLiBot|BomboraBot|Leikibot|weborama-fetcher|NTENTbot|Screaming Frog SEO Spider|admantx-usaspb|Eyeotabot|VoluumDSP-content-bot|SirdataBot|adbeat_bot|TTD-Content|admantx|Nimbostratus-Bot|Mail.RU_Bot|Quantcastboti|Onespot-ScraperBot|Taboolabot|Baidu|Jobboerse|VoilaBot|Sogou|Jyxobot|Exabot|ZGrab|Proximi|Sosospider|Accoona|aiHitBot|Genieo|BecomeBot|ConveraCrawler|NerdyBot|OutclicksBot|findlinks|JikeSpider|Gigabot|CatchBot|Huaweisymantecspider|Offline Explorer|SiteSnagger|TeleportPro|WebCopier|WebReaper|WebStripper|WebZIP|Xaldon_WebSpider|BackDoorBot|AITCSRoboti|Arachnophilia|BackRub|BlowFishi|perl|CherryPicker|CyberSpyder|EmailCollector|Foobot|GetURL|httplib|HTTrack|LinkScan|Openbot|Snooper|SuperBot|URLSpiderPro|MAZBot|EchoboxBot|SerendeputyBot|LivelapBot|linkfluence.com|TweetmemeBot|LinkisBot|CrowdTanglebot") { return 403; }

  location / {
    proxy_pass http://127.0.0.1:3001;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
    proxy_read_timeout 600s;
    add_header Access-Control-Allow-Origin *;
  }

  # redirect
  location ~* "^/archives/([0-9]{5,6})$" {
    return 302 /post/$1;
  }

  # proxy pass
  location ~* "^/somepath/posts/([0-9]{5,6})$" { proxy_pass http://_backend; }


  location /static {
    alias /var/www/domain.com/data;
    index index.html;
    add_header Access-Control-Allow-Origin *;

    autoindex off;

    proxy_intercept_errors on;
    error_page 404 = @dynamic_catch_404;
  }


  location @dynamic_catch_404 {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
    proxy_read_timeout 600s;
    add_header Access-Control-Allow-Origin *;
    #return 200;
  }

  location /something {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
  }

}
</code></pre>
]]></description><link>https://bb.aizu.my/topic/29/nginx-conf-sample</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 02:50:48 GMT</lastBuildDate><atom:link href="https://bb.aizu.my/topic/29.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 Sep 2023 08:37:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to nginx conf - sample on Fri, 15 Nov 2024 09:14:07 GMT]]></title><description><![CDATA[<p dir="auto">redirect</p>
<pre><code>server {
  server_name .mydomain.example;
  rewrite ^ http://www.adifferentdomain.example$request_uri? permanent;
}
</code></pre>
<p dir="auto">or on any version 0.9.1 or higher:</p>
<pre><code>server {
  server_name .mydomain.example;
  return 301 http://www.adifferentdomain.example$request_uri;
}
</code></pre>
<p dir="auto">HTTP redirect:</p>
<ul>
<li>301 (permanent)</li>
<li>302 (temporary)</li>
</ul>
]]></description><link>https://bb.aizu.my/post/85</link><guid isPermaLink="true">https://bb.aizu.my/post/85</guid><dc:creator><![CDATA[aizu]]></dc:creator><pubDate>Fri, 15 Nov 2024 09:14:07 GMT</pubDate></item><item><title><![CDATA[Reply to nginx conf - sample on Sat, 09 Sep 2023 03:33:15 GMT]]></title><description><![CDATA[<pre><code>server {
  listen 80;
  #server_name ~^ (?&lt;subdomain&gt;.+)\.domain\.com$;

  server_name "~^(?&lt;subdomain&gt;[a-z0-9]{32}+)\.domain\.com$";

  # server_name "~^(www.)?ucwebapi(-uccore)?(\d{1,3}-\d{1,3})?\.domain\.com";

  root /var/www/symfny.io/public_frontend/src/out;
  index index.html;
}
</code></pre>
]]></description><link>https://bb.aizu.my/post/38</link><guid isPermaLink="true">https://bb.aizu.my/post/38</guid><dc:creator><![CDATA[aizu]]></dc:creator><pubDate>Sat, 09 Sep 2023 03:33:15 GMT</pubDate></item></channel></rss>