Welcome to Centmin Mod Community
Become a Member

How can I enable CORS for Nginx?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, May 9, 2017.

  1. pamamolf

    pamamolf Well-Known Member

    2,539
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    10:00 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed:1.13.0
    • PHP Version Installed: 7.0.18
    • MariaDB MySQL Version Installed: 10.1.23
    • When was last time updated Centmin Mod code base ? : just now


    Hello :)

    How can I enable CORS for Nginx?

    https://enable-cors.org/server_nginx.html

    Do I need to recompile?
    What parameters to use?
    Any way to make it persistent?

    Can that cause any issues related to Let's Encrypt?

    Thank you
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    5:00 PM
    Nginx 1.13.x
    MariaDB 5.5
    no CORS is purely nginx header configuration you need to figure out and yes it can cause issues if misconfigured

    you're on your own configuring CORS headers, read https://enable-cors.org/resources.html

    Using CORS - HTML5 Rocks