Learn about Centmin Mod LEMP Stack today
Register Now

Nginx Serving files from outside domain root via symlink

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Tracy Perry, Aug 12, 2022.

  1. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    12:45 PM
    1.21.6
    MariaDB 10.3.36
    • CentOS Version: CentOS 7 64 bit
    • Centmin Mod Version Installed: 124 stable
    • Nginx Version Installed: 1.21.6
    • PHP Version Installed:8.0.22
    • MariaDB MySQL Version Installed: 10.1.48
    • When was last time updated Centmin Mod code base ? : 2 days ago
    • Persistent Config:
      Code (Text):
      PUREFTPD_DISABLED='y'
      ZONEINFO=America/Chicago
      LETSENCRYPT_DETECT='y'
      NGINX_IPV='y'
      PHP_PGO='y'
      NGXDYNAMIC_BROTLI='y'
      NGINX_LIBBROTLI='y'
      ENABLE_MARIADBTENTWOUPGRADE='y'
      MARIADB_INSTALLTENTHREE='y'
      LETSENCRYPT_DETECT='y'
      MARCH_TARGETNATIVE='n'
      NGXDYNAMIC_GEOIPTWOLITE='y'
      

    Running the site on Digital Ocean and about to get a 100GB bucket added to it not only for my site use, but for another to place files on for secured download.

    I'll be mounting it in the /mnt location, and would like to point the XF data stores (mainly images) at it since it will be 5 times larger than what I have available now. I remember that at one time nginx would NOT let you use a symlink from it's home /public directory for the domain outside of the root. But I also remember that there was a setting that would allow that, if I remember correctly, you could point at the specific directory the symlink pointed ot.


    Am I imagining things in my old age?
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,363
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    4:45 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Maybe you're looking for Nginx alias directive Module ngx_http_core_module ?

     
  3. eva2000

    eva2000 Administrator Staff Member

    54,363
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    4:45 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    BTW, if it's S3 API compatible buckets also checkout JuiceFS for mounting. Been playing with Cloudflare R2 S3 buckets and JuiceFS GitHub - centminmod/centminmod-juicefs: JuiceFS file system for S3 mount storage

    Code (Text):
    df -hT /home/juicefs_mount
    Filesystem        Type          Size  Used Avail Use% Mounted on
    JuiceFS:myjuicefs fuse.juicefs  1.0P     0  1.0P   0% /home/juicefs_mount
    
     
    Last edited: Aug 12, 2022
  4. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    12:45 PM
    1.21.6
    MariaDB 10.3.36
    They offer a S3 compatible solution.. but basically all this consists of is an additional storage bucket directly associated with the VPS and mounted as a drive. From my understanding it's the equivalent of adding another drive into a system.
    If the site gets to using a lot of storage, I'll then convert it over to Amazon S3 storage most likely as I already use Amazon SES.

    Thanks!