1
server {
        listen 80;
        server_name dev.com;
        server_tokens off;
        location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root /etc/letsencrypt;
        try_files $uri $uri/ =404;
        auth_basic          off;
        }
            return 301 https://dev.com$request_uri;
}

server {
        server_name dev.com;
        server_tokens off;
        access_log /var/log/nginx/dev.com.access.log;
        listen 443 ssl;
        ssl on;
        ssl_certificate /etc/nginx/ssl/dev.com.crt;
        ssl_certificate_key /etc/nginx/ssl/dev.com.key;
        ssl_stapling on;
        ssl_session_timeout 24h;
        ssl_protocols TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_dhparam /etc/ssl/certs/dhparam.pem;
        ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
        resolver 8.8.8.8;
        client_max_body_size 50m;
        gzip on;
        gzip_disable "msie6";
        gzip_comp_level 9;
        gzip_min_length 1100;
        gzip_buffers 16 8k;
        gzip_proxied any;
        gzip_types
            text/plain
            text/css
            text/js
            text/xml
            text/javascript
            application/javascript
            application/x-javascript
            application/json
            application/xml
            application/xml+rss;
        root /var/www/dev.com/front/build;
        fastcgi_intercept_errors on; 
        location / {
              try_files $uri $uri/ /index.html;
        }

      location ^~ /api {
         alias /var/www/dev.com/v3/public;
         index index.php;
         try_files $uri $uri/   /index.php?$args;  
        location ~ \.php$ {
          fastcgi_pass  127.0.0.1:9005;
          include snippets/fastcgi-php.conf;
          fastcgi_param SCRIPT_FILENAME $request_filename;
       }
      }
      location  /api/public {
         alias /var/www/dev.com/v3/public;
         index index.php;
         try_files $uri $uri/ index.php;
        location ~ \.php$ {
          fastcgi_pass  127.0.0.1:9005;
          include fastcgi_params;
          include snippets/fastcgi-php.conf;
          fastcgi_param SCRIPT_FILENAME $request_filename;
       }
      }
        location /api/chatty/ {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host      $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_pass http://127.0.0.1:9000/;
            proxy_read_timeout 86400;
            break;

        }
            location ^~ /.well-known/acme-challenge/ {
            default_type "text/plain";
            root /etc/letsencrypt;
            try_files $uri $uri/ =404;
            auth_basic          off;
        }
}


<VirtualHost 0.0.0.0:8080>
  ServerName dev.com
  DocumentRoot /var/www/dev.com
  ServerAdmin dev@admin.com
  UseCanonicalName Off
  CustomLog /var/log/apache2/dev.com.log combined
  <Directory "/var/www/dev.com">
    AllowOverride All
    Options -Indexes
  </Directory>
Apache versions >= 2.4.
SSILegacyExprParser in
/mod/mod_include.html#ssilegacyexprparser
</VirtualHost>

Nginx static works well but I can't login with user:pass to get token. If i proxy pass to apache everythin works ok with Apache

Browse other questions tagged or ask your own question.