Nginx error using listener 10_nginx_hsts on i-MSCP 1.4.4

  • Hello,


    when using listener 10_nginx_hsts.pl during installation of i-MSCP 1.4.4 I get an error that Nginx cannot be started due to an error.
    The Nginx error log gives following error message: "add_header" directive is not allowed here in /etc/nginx/sites-enabled/00_master:25.
    I am using Nginx with following version nginx version: nginx/1.10.0 (Ubuntu)
    Can anybody confirm this? Is there any solution except disabling this feature?
    Thanks in advance for any feedback.


    Regards Jörg

    (Ubuntu 16.04, i-MSCP 1.5.1, php-Fpm, Plugins: ClamAV, CronJobs, InstantSSH, LetsEncrypt, Mailgraph, Monitorix, OpenDKIM, PhpSwitcher, PolicydSPF, Postscreen, RecaptchaPMA, RoundcubePlugins, ServerDefaultPage, SpamAssassin, YubiKeyAuth)

  • badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Nuxwin,


    yes I am using this version.


    Regards Jörg

    (Ubuntu 16.04, i-MSCP 1.5.1, php-Fpm, Plugins: ClamAV, CronJobs, InstantSSH, LetsEncrypt, Mailgraph, Monitorix, OpenDKIM, PhpSwitcher, PolicydSPF, Postscreen, RecaptchaPMA, RoundcubePlugins, ServerDefaultPage, SpamAssassin, YubiKeyAuth)

  • @UncleJ


    Thanks. Confirmed. I'll investigate further this evening.


    Shell-Script
    1. root@devuan:~# nginx -t
    2. nginx: [emerg] "add_header" directive is not allowed here in /etc/nginx/sites-enabled/00_master:21
    3. nginx: configuration file /etc/nginx/nginx.conf test failed

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @UncleJ



    Unfortunatelly, the if statement can only be placed inside a location block... I'll update the listener this evening to place that statement in the location / { } block but note that this will not cover all locations. In the i-MSCP version 1.4.5, I'll revert-back merging of both http and https vhosts and then, we will be able to add the HSTS header statement at the server level.


    Sorry for the inconvenience.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hi @Nuxwin,


    sorry to hear because I generally liked the idea of merging both files because redundant information have always the issue of being not the same as they should be.
    Nevertheless I can live with the temporary solution and am convinced that you find an appropriate way to handle this issue.
    Thanks for the effort.


    Regards Jörg

    (Ubuntu 16.04, i-MSCP 1.5.1, php-Fpm, Plugins: ClamAV, CronJobs, InstantSSH, LetsEncrypt, Mailgraph, Monitorix, OpenDKIM, PhpSwitcher, PolicydSPF, Postscreen, RecaptchaPMA, RoundcubePlugins, ServerDefaultPage, SpamAssassin, YubiKeyAuth)

  • A fix has been added in our development branch. See https://github.com/i-MSCP/imsc…dbdbea4bf5...4a13ef40d2d6
    This fix will be part of next release.


    Thank you for your report.
    Thread closed.



    @UncleJ


    I'll provide you with a temporary solution as soon as possible.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206