{"action":"created","issue":{"url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle/issues/501","repository_url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle","labels_url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle/issues/501/labels{/name}","comments_url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle/issues/501/comments","events_url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle/issues/501/events","html_url":"https://github.com/lexik/LexikJWTAuthenticationBundle/issues/501","id":329160394,"node_id":"MDU6SXNzdWUzMjkxNjAzOTQ=","number":501,"title":"login_check returns 404 error on production while works well in development","user":{"login":"Aerendir","id":1968622,"node_id":"MDQ6VXNlcjE5Njg2MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1968622?v=4","gravatar_id":"","url":"https://api.github.com/users/Aerendir","html_url":"https://github.com/Aerendir","followers_url":"https://api.github.com/users/Aerendir/followers","following_url":"https://api.github.com/users/Aerendir/following{/other_user}","gists_url":"https://api.github.com/users/Aerendir/gists{/gist_id}","starred_url":"https://api.github.com/users/Aerendir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aerendir/subscriptions","organizations_url":"https://api.github.com/users/Aerendir/orgs","repos_url":"https://api.github.com/users/Aerendir/repos","events_url":"https://api.github.com/users/Aerendir/events{/privacy}","received_events_url":"https://api.github.com/users/Aerendir/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-04T18:07:51Z","updated_at":"2018-08-16T08:57:06Z","closed_at":"2018-06-05T09:46:58Z","author_association":"NONE","body":"As per the title, on local development machine all works as expected while on production I get a 404 error (not found).\r\n\r\nI really don't understand why there is this difference in the behaviour as I double checked all what I can.\r\n\r\nI'm on Symfony 4.1 and this is my configuration:\r\n\r\n```yaml\r\n# config/routes.yaml\r\nlogin_check:\r\n    path:     /api/login_check\r\n    methods:  [POST]\r\n    defaults:\r\n        _format: json\r\n```\r\n\r\nand the firewalls:\r\n\r\n```yaml\r\n# config/packages/security\r\nsecurity:\r\n    ...\r\n    firewalls:\r\n        # disables authentication for assets and the profiler, adapt it according to your needs\r\n        dev:\r\n            pattern: ^/(_(profiler|wdt)|css|images|js)/\r\n            security: false\r\n        login:\r\n            pattern: ^/api/login\r\n            stateless: true\r\n            anonymous: true\r\n            json_login:\r\n                check_path: /api/login_check\r\n                success_handler: lexik_jwt_authentication.handler.authentication_success\r\n                failure_handler: lexik_jwt_authentication.handler.authentication_failure\r\n        register:\r\n            pattern: ^/api/register\r\n            stateless: true\r\n            anonymous: true\r\n        api:\r\n            # Add the trailing slash to enable the Swagger UI (https://stackoverflow.com/a/49967251/1399706)\r\n            pattern: ^/api/\r\n            stateless: true\r\n            anonymous: false\r\n            provider: entity_provider\r\n            guard:\r\n                authenticators:\r\n                    - lexik_jwt_authentication.jwt_token_authenticator\r\n        main:\r\n            pattern: ^/\r\n            anonymous: true\r\n    access_control:\r\n        - { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }\r\n        - { path: ^/api/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }\r\n        # Add the trailing slash to enable the Swagger UI (https://stackoverflow.com/a/49967251/1399706)\r\n        - { path: ^/api/, roles: IS_AUTHENTICATED_FULLY }\r\n```\r\n\r\nI have no different `security.yaml` in `dev` environment nor in the `prod` one.\r\n\r\nAny idea is welcomed!"},"comment":{"url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle/issues/comments/413474965","html_url":"https://github.com/lexik/LexikJWTAuthenticationBundle/issues/501#issuecomment-413474965","issue_url":"https://api.github.com/repos/lexik/LexikJWTAuthenticationBundle/issues/501","id":413474965,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzQ3NDk2NQ==","user":{"login":"hugoalexmartins","id":3170222,"node_id":"MDQ6VXNlcjMxNzAyMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/3170222?v=4","gravatar_id":"","url":"https://api.github.com/users/hugoalexmartins","html_url":"https://github.com/hugoalexmartins","followers_url":"https://api.github.com/users/hugoalexmartins/followers","following_url":"https://api.github.com/users/hugoalexmartins/following{/other_user}","gists_url":"https://api.github.com/users/hugoalexmartins/gists{/gist_id}","starred_url":"https://api.github.com/users/hugoalexmartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hugoalexmartins/subscriptions","organizations_url":"https://api.github.com/users/hugoalexmartins/orgs","repos_url":"https://api.github.com/users/hugoalexmartins/repos","events_url":"https://api.github.com/users/hugoalexmartins/events{/privacy}","received_events_url":"https://api.github.com/users/hugoalexmartins/received_events","type":"User","site_admin":false},"created_at":"2018-08-16T08:57:06Z","updated_at":"2018-08-16T08:57:06Z","author_association":"NONE","body":"Hey @Aerendir , I am facing the same issue.\r\n\r\nI have changed my VistualHost to this\r\n\r\n<VirtualHost *:80>\r\n  ServerName visa.local.com\r\n  ServerAlias visa.local.com\r\n  DocumentRoot \"/Users/hugomartins/projectos/visaexpress/visaExpress/web\"\r\n\r\n  <Directory \"/Users/hugomartins/projectos/visaexpress/visaExpress/web\">\r\n    Require all granted\r\n    AllowOverride All\r\n    Order Allow,Deny\r\n    Allow from All\r\n  </Directory>\r\n\r\n  SetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=$1\r\n</VirtualHost>\r\n\r\n\r\nLet me know if I am doing fine, because so far the route login_check in production gives me 404 not found, but in dev mode works correctly.\r\n\r\nThanks in advance."}}
{"actor":{"display_login":"hugoalexmartins"}}